in reply to I cannot create backup copy during file name change
Update: removed stupid comment; added below para on use of rename
Update2: jethro holds -- with good reason, ++ -- that the 'stupid remark' is the observation that _oldname_ can't match. He's right; I should have allowed for cases in the sort of format OP has now described, below; however, OP's use of glob "*.txt" would never find the .pdf files asserted in Re^2: I cannot create backup copy during file name change.
FTR, the point was not to make OP look foolish; rather, it is that one should cut'n'paste (double-checked) code into PM nodes, to avoid such goofs, rather than risk the hazards of retyping something that already exists in digital form.
(...and, BTW, the remark removed was even stupider)
Also, perldoc -f rename tells us
rename OLDNAME,NEWNAME
Changes the name of a file; an existing file NEWNAME will be
clobbered. Returns true for success, false otherwise.
Behavior of this function varies wildly depending on your system
implementation. For example, it will usually not work across...
which is (IMO) very nearly a deprecation message.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I cannot create backup copy during file name change
by jethro (Monsignor) on Jul 24, 2012 at 16:31 UTC | |
|
Re^2: I cannot create backup copy during file name change
by rnaeye (Friar) on Jul 24, 2012 at 16:33 UTC | |
by ww (Archbishop) on Jul 24, 2012 at 16:39 UTC | |
by rnaeye (Friar) on Jul 24, 2012 at 17:40 UTC |