markfasheh / duperemove

Tools for deduping file systems
GNU General Public License v2.0
795 stars 80 forks source link

Providing pathnames with special characters #221

Closed businessBoris closed 4 years ago

businessBoris commented 5 years ago

If the filenames provided to duperemove have spaces or other should-be-escaped characters, what happens?

I notice that there isn't a "-0" option such as with xargs and I didn't read anything in the help that have me a clue.

I'm not sure I haven't been stupid in asking this question. It may be really obvious!

Thank-you.

Reasoning: I want to submit a subset of all files to duperemove using "find -print0" / list of files output (so that I can exclude some files).

lorddoskias commented 4 years ago

This should just work. Here is my test:

cp mnt-test/file2 mnt-test/file\ with\ space
cp mnt-test/file2 mnt-test/file\\with\\spec\'char

ls -la mnt-test/
total 1044
drwxr-xr-x 1 nborisov root        114 юли  7 17:29  .
drwxrwxr-x 5 nborisov nborisov   4096 юли  7 15:53  ..
-rw------- 1 nborisov nborisov 262144 юни 15 12:33  file1
-rw------- 1 nborisov nborisov 262144 юни 15 12:33  file2
-rw------- 1 nborisov nborisov 262144 юли  7 17:29 'file with space'
-rw------- 1 nborisov nborisov 262144 юли  7 17:29 'file\with\spec'\''char'
drwxrwxr-x 1 nborisov nborisov     10 юни 17 18:33  subdir
drwxrwxr-x 1 nborisov nborisov     10 юни 22 15:58  subdir2

./duperemove -r mnt-test/
Gathering file list...
Using 24 threads for file hashing phase
[1/6] (16.67%) csum: /home/nborisov/projects/kernel/duperemove/mnt-test/file1
[3/6] (50.00%) csum: /home/nborisov/projects/kernel/duperemove/mnt-test/subdir/file1
[4/6] (66.67%) csum: /home/nborisov/projects/kernel/duperemove/mnt-test/subdir2/file1
[2/6] (33.33%) csum: /home/nborisov/projects/kernel/duperemove/mnt-test/file2
[5/6] (83.33%) csum: /home/nborisov/projects/kernel/duperemove/mnt-test/file with space
[6/6] (100.00%) csum: /home/nborisov/projects/kernel/duperemove/mnt-test/file\with\spec'char
Total files:  6
Total extent hashes: 7
Loading only duplicated hashes from hashfile.
Found 5 identical extents.
Simple read and compare of file data found 1 instances of extents that might benefit from deduplication.
Showing 5 identical extents of length 262144 with id 8fc2b6b0
Start       Filename
0   "/home/nborisov/projects/kernel/duperemove/mnt-test/subdir/file1"
0   "/home/nborisov/projects/kernel/duperemove/mnt-test/subdir2/file1"
0   "/home/nborisov/projects/kernel/duperemove/mnt-test/file2"
0   "/home/nborisov/projects/kernel/duperemove/mnt-test/file with space"
0   "/home/nborisov/projects/kernel/duperemove/mnt-test/file\with\spec'char"

Is there any specific issue you have encountered?

lorddoskias commented 4 years ago

Closing due to inactivity and my reply above.