http://qs321.pair.com?node_id=24076


in reply to Deleting Files on NT

I bet you don't supply the full path to the file you are trying to delete.
my $dir = "dir/foo"; opendir(DIR, $dir); foreach my $file ( readdir DIR ) { unlink "$dir/$file"; }
As to the dates of files: You use it like this:
my $m_time = -M "$dir/$file";
But you can also use the stat command. But remember to give a correct path to the file or else it will obviously not work :-)

As a note, I still do this error all the time :-) Autark

Replies are listed 'Best First'.
RE: RE: Deleting Files on NT
by steveAZ98 (Monk) on Jul 24, 2000 at 18:38 UTC
    Ha, your not the only one!
    Thanks for the -M, -A, -C didn't know about them.