pixelb / fslint

Linux file system lint checker/cleaner
319 stars 72 forks source link

findup can't delete files with space as the last filename character #78

Closed pixelb closed 9 years ago

pixelb commented 9 years ago

Original issue 79 created by pixelb on 2012-04-26T20:45:43.000Z:

What steps will reproduce the problem?

  1. make a test directory, e.g. mkdir ./testdir
  2. put duplicate files in the directory, two or more should be named with a space as their last filename character, e.g.: a. echo "foo" > './testdir/foo' b. cp ./testdir/foo './testdir/foo ' c. cp ./testdir/foo './testdir/spacefile ' d. cp ./testdir/foo './testdir/tfile '
  3. cd testdir ; findup -d

This should delete all duplicate files, save one. Instead you get something like: [Errno 2] No such file or directory: 'spacefile' [Errno 2] No such file or directory: 'tfile'

Note that the files are actually 'spacefile ' and 'tfile ' (spaces at the end of their names)

only 'foo' was deleted, 'foo ', 'spacefile ', and 'tfile ' all remain.

fslint 2.42-1 on CentOS, ext4 filesystem

pixelb commented 9 years ago

Comment #1 originally posted by pixelb on 2012-04-30T10:24:46.000Z:

Fixed in r276

pixelb commented 9 years ago

Comment #2 originally posted by pixelb on 2012-04-30T14:27:14.000Z:

Works like a charm,

Thanks!