Giter Site home page Giter Site logo

Same Filename handling about rifec HOT 1 OPEN

mawosch avatar mawosch commented on May 28, 2024
Same Filename handling

from rifec.

Comments (1)

kristofg avatar kristofg commented on May 28, 2024

Hm, yeah, that's true. I've set all my cameras to use sequential file names (ie. don't reset the counter when the card is emptied), so all my .1 files tend to be duplicates. I haven't really considered the use case where you want to keep both versions.

I'm a bit sceptical of messing about "inside" the file names; a trailing .1 is easy to identify and remove. foo123.jpg -> foo123-A.jpg / foo123-1.jpg / foo123+1.jpg can be much harder to identify unambigously (depending on the camera naming scheme, of course). But that may be too much paranoia. I'll have to think about it for a bit.

To solve your immediate problem, the sprintf() call in RIFEC::File::_link_file() would be the place to look. For your use case, I'm guessing you could change the single sprintf() to something like this (Note: this code is NOT TESTED):

my ($base, $ending) = split /\./, $destination_name, 2;
my $newbase = sprintf("%s+%d", $base, ++$tries);
$dst = join('.', $newbase, $ending);

from rifec.

Related Issues (14)

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.