Code Monkey home page Code Monkey logo

Comments (5)

mtimkovich avatar mtimkovich commented on June 3, 2024

Would you happen to be on FreeBSD?

from pipe-rename.

lamyergeier avatar lamyergeier commented on June 3, 2024

Ubuntu 20.4

from pipe-rename.

mtimkovich avatar mtimkovich commented on June 3, 2024

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?

check_input_files(&input_files)?;

from pipe-rename.

assarbad avatar assarbad commented on June 3, 2024

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)'

from pipe-rename.

assarbad avatar assarbad commented on June 3, 2024

@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.

from pipe-rename.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.