Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autorename when copying/moving files #279

Open
mc-butler opened this issue Feb 20, 2009 · 2 comments
Open

Autorename when copying/moving files #279

mc-butler opened this issue Feb 20, 2009 · 2 comments
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.6.2 Reproducible in version 4.6.2

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/279
Reporter styx (@styx)

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.

@mc-butler
Copy link
Author

Changed by kdave (@kdave) on Feb 21, 2009 at 16:48 UTC

Replying to styx (#279):

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=[.]$".

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on May 15, 2009 at 12:31 UTC (comment 2)

  • Milestone changed from 4.7 to future releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.6.2 Reproducible in version 4.6.2
Development

No branches or pull requests

1 participant