|
5 | 5 | "errors" |
6 | 6 | "fmt" |
7 | 7 | "os" |
8 | | - "path/filepath" |
| 8 | + slpath "path" |
9 | 9 | "slices" |
10 | 10 | "time" |
11 | 11 |
|
@@ -116,7 +116,7 @@ func NewDedup(path string, indexName string, createIfNotExists bool) (*Dedup, er |
116 | 116 | LogQueue: make(chan *LogEvent, 100), |
117 | 117 | PerfQueue: make(chan *DedupPerfEvent, 100), |
118 | 118 | } |
119 | | - dedupFile := filepath.Join(path, d.indexName+dedupSuffix) |
| 119 | + dedupFile := slpath.Join(path, d.indexName+dedupSuffix) |
120 | 120 |
|
121 | 121 | _, err = os.Stat(dedupFile) |
122 | 122 | if err != nil { |
@@ -254,7 +254,7 @@ func (d *Dedup) DetectDupes(minSize uint64, verbose bool) (err error) { |
254 | 254 | for hash, bag := range all { |
255 | 255 | if bag.Size == -1 { |
256 | 256 | for _, p := range bag.ItemList { |
257 | | - if s, err := os.Stat(filepath.Join(d.rootPath, p.Path)); err == nil { |
| 257 | + if s, err := os.Stat(slpath.Join(d.rootPath, p.Path)); err == nil { |
258 | 258 | bag.Size = s.Size() |
259 | 259 | break |
260 | 260 | } |
@@ -319,7 +319,7 @@ func (d *Dedup) DetectDupes(minSize uint64, verbose bool) (err error) { |
319 | 319 | var matches []match |
320 | 320 | d.perfMonFiles(len(bag.ItemList), float64(i), len(all)) |
321 | 321 | for _, item := range bag.ItemList { |
322 | | - if res, err := GetFileExtents(filepath.Join(d.rootPath, item.Path)); err == nil { |
| 322 | + if res, err := GetFileExtents(slpath.Join(d.rootPath, item.Path)); err == nil { |
323 | 323 | matches = append(matches, match{-1, res, item}) |
324 | 324 | } else if IsNotSupported(err) { |
325 | 325 | matches = append(matches, match{-1, nil, item}) |
@@ -508,8 +508,8 @@ func (d *Dedup) Dedup(hashes []string, verbose bool) error { |
508 | 508 | } |
509 | 509 |
|
510 | 510 | if !list[i].Merged { |
511 | | - a := filepath.Join(d.rootPath, list[0].Path) |
512 | | - b := filepath.Join(d.rootPath, list[i].Path) |
| 511 | + a := slpath.Join(d.rootPath, list[0].Path) |
| 512 | + b := slpath.Join(d.rootPath, list[i].Path) |
513 | 513 | if verbose { |
514 | 514 | d.logMsg(fmt.Sprintf("dedup %s %s \"%s\" -- \"%s\"", hash, intutil.FormatSize(uint64(bag.Size)), a, b)) |
515 | 515 | } else { |
|
0 commit comments