Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

RE: Deleting Files on NT

by autark (Friar)
on Jul 24, 2000 at 18:35 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-24 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found