Closed lamyergeier closed 1 year ago
Would you happen to be on FreeBSD?
Ubuntu 20.4
I can't replicate this on my machine 😕 Does this only happen for files with spaces or does this happen every time?
Are you able to compile the code? If so what happens if you run renamer with this line commented?
Error is shown even if file exists!
$ ls PARSIFAL - Bavarian State Opera-1.mp4 PARSIFAL - Bavarian State Opera-3.mp4 PARSIFAL - Bavarian State Opera-2.mp4 PARSIFAL - Bavarian State Opera.mp4
But these two files (!) do not exist, do they 😉?
And that is the reason why you shouldn't use ls
as input for pipes in general or parse its output, especially without some basic precautions. E.g. using ls -1
(and yes, some ls
flavors will turn this on when they detect a pipe) or ls -Q
(no idea if this would work, given how renamer implements its logic) etc.
The appropriate (and more powerful) option is to use find -type f
if you want to really pipe the input, but renamer will also happily do renamer *
for this particular case (proved by the output in your own initial comment).
$ ls | renamer The following input files do not exist: PARSIFAL - Bavarian State Opera-1.mp4 PARSIFAL - Bavarian State Opera-3.mp4 PARSIFAL - Bavarian State Opera-2.mp4 PARSIFAL - Bavarian State Opera.mp4 Error: Nonexisting input files. Aborting.
Yep, clearly they don't exist as your subsequent ls -la
proves. At least I don't see two files named:
PARSIFAL - Bavarian State Opera-1.mp4 PARSIFAL - Bavarian State Opera-3.mp4
PARSIFAL - Bavarian State Opera-2.mp4 PARSIFAL - Bavarian State Opera.mp4
... instead it's four files:PARSIFAL - Bavarian State Opera-1.mp4
PARSIFAL - Bavarian State Opera-2.mp4
PARSIFAL - Bavarian State Opera-3.mp4
PARSIFAL - Bavarian State Opera.mp4
... whose names end in .mp4
and starts with PARSIFAL
, right?Your shell should have done the right thing for you with renamer *
and renamer would have interpreted it correctly (actually it did as the last line of output you provided proves).
What shell are you using? Perhaps provide the output of the following commands:
$SHELL --version; env|grep -E '^(LC_|LANG|EDITOR)'
@mtimkovich @marcusbuffett I strongly suggest closing this. This seems to be a case of wrong usage rather than a defect in renamer
as I showed in my previous comment.
Error is shown even if file exists!