Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

RE: Deleting Files on NT

by autark (Friar)
on Jul 24, 2000 at 18:35 UTC ( #24076=note: print w/replies, xml ) Need Help??

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:
  • -M Age of file in days when script started.
  • -A Same for access time.
  • -C Same for inode change time.
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://24076]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2020-11-27 12:15 GMT
Find Nodes?
    Voting Booth?

    No recent polls found