in reply to Moving Log files remotely
use File::Spec; use File::Copy; # Here's where some of your code is that sets some variables, gets the + timestamp in array context... $year += 1900; # Y2K-compliant my $dir_prefix = sprintf("%04d%02d%02d%02d%02d%02d", $year, $mon, $mda +y, $hour, $min, $sec); my $create_dir = File::Spec->catfile($filedir, $dir_prefix); if (!-e $create_dir) { if (!mkdir($create_dir)) { # Do something. } else { if (!move($IWlogs, $create_dir)) { # Do something. } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Moving Log files remotely
by Anonymous Monk on Sep 10, 2002 at 21:21 UTC | |
by Mr. Muskrat (Canon) on Sep 10, 2002 at 21:27 UTC | |
by Flexx (Pilgrim) on Sep 12, 2002 at 18:17 UTC |