Ticket #279 (new enhancement)

Opened 16 years ago

Last modified 15 years ago

Autorename when copying/moving files

Reported by: styx Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: 4.6.2
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset:

Description

When files with the same names already exists, should be a button, to copy the files with autorenaming.

result: file.txt, 2.file.txt 3.file.txt 4.file.txt
or: file.txt, file.txt.2 file.txt.3 file.txt.4
or: file.txt, file(2).txt file(3).txt file(4).txt
maybe user should have a posibility to set a rule how to rename via regexp or something like that.

Change History

comment:1 in reply to: ↑ description Changed 16 years ago by kdave

Replying to styx:

When files with the same names already exists, should be a button, to copy the files with autorenaming.

Sounds reasonable. Howeve I see problems with the autorename rules. I think regexp pattern is not the best way to do that, since filenames can be of any form (eg. no ".extension", etc).

result: file.txt, 2.file.txt 3.file.txt 4.file.txt

This does not seem good since I want to see the renamed files togather. They may have same name but different contents. Prefixing the name with number will list the files far away from each other.

or: file.txt, file.txt.2 file.txt.3 file.txt.4

This resembles manpage names, it does add anotherl level of "extension" wich again may lead to different associated program to call via mcext.

or: file.txt, file(2).txt file(3).txt file(4).txt

This one is good, preserves the extension (if there is any), number can be extracted and incremented.

maybe user should have a posibility to set a rule how to rename via regexp or something like that.

Rather some printf-like syntax using %f %e %n, f - filename up to last ".", e - "extension", n - the number to increment. Using regexp for such task does not seem to be appropriate.

I think MC should use a robust renaming scheme internally, and user should not need to change it in most cases, but it should be possible. Eg. to change the scheme to "%f_%n.%e".

Thinking further, the regex approach may nicely extend the "printf" scheme. Each of the %x macros can have it's own regexp configurable. Eg. "%e=[.]$".

comment:2 Changed 16 years ago by angel_il

  • Milestone changed from 4.7 to future releases
Note: See TracTickets for help on using tickets.