Skip Menu |

This queue is for tickets about the File-Rename CPAN distribution.

Report information
The Basics
Id: 127093
Status: resolved
Priority: 0/
Queue: File-Rename

People
Owner: RMBarker [...] cpan.org
Requestors: RMBarker [...] cpan.org
Cc: m [...] qjym.de
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.00
Fixed in:
  • 1.09_02
  • 1.09_04
  • 1.10



CC: m [...] qjym.de
Subject: [File::Rename] [feature request] filename-only operation
I just wanted to do something like this: find */ -somecriteria | rename s/^/_/ , that is, rename some files that are spread over different subfolders. However, this didn't work, because `rename` operates on the whole path, not just the filename, so it tried to rename `dir/some/file` to `_dir/some/file` (which failed) instead of `dir/some/_file` as I expected. While there may be use cases for this whole-path operation, I assume a filename-only mode is also quite useful in some cases. Thus, I suggest to add an option, `--filename` or so, that makes the replacement only change the filename part of the path. It could be used as follows: rename --filename s/^/img_/ */*.jpeg or find -mtime +365 | rename --filename s/^foo_/old_foo_/ etc.
RT-Send-CC: m [...] qjym.de
Version 1.09_02 is a beta-test implementation, as C<rename -d>