Re: find/copy most recent version of file?



"JB" == John Bokma <john@xxxxxxxxxxxxxxx> writes:

JB> "Uri Guttman" <uri@xxxxxxxxxxxxxxx> writes:
>>>>>>> "G" == Geoff <geoff@xxxxxxxxxxxxxxx> writes:
>>
G> The code below works, i.e. I get the latest set of files!
>>
>> for some value of work.
>>
G> my $file_name ='';
G> my %file_access;
G> my %file_full;
G> my $destiny = "c:/a-temp3/$file_name";
>>
>> what do you think is in $destiny now? what was in $file_name? this does
>> not do what you seem to think it does. interpolation is not delayed.

JB> [1] if dest is a dir, the file is copied into the dir, what's what the
JB> OP want.

my concern (docs not checked) is whether file::copy will handle a
filename in the dest dir with missing dir parts. as in the dest is /foo
and the file is found in bar/baz.text. will copy work with
/foo/bar/baz.text is bar isn't there? unix cp won't handle that. this
was my guess as to some of the errors the OP was getting but given no
proper debug printing and the usual nonsense from the OP, i wasn't sure.

uri

--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
.