CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
How do I remove a file?

 



VoodooMill
Deleted

Jun 27, 2000, 3:09 PM

Post #1 of 2 (443 views)
How do I remove a file? Can't Post

Hey there,

I'm running my scripts under Win 2000. How do I remove. What I'm trying to do is remove all files in a directory that have not been modified for 7 days or more.

Here's my code:

while(defined($filename = glob("path of file in directory")))
{
open(FILE, "<$filename")
if(-M FILE >= 7)
unlink(FILE);
}

What am I doing wrong? Needless to say it creates errors and is driving me insane...otherwise I wouldn't be here asking for help Smile

Thanks,

VoodooMill.....

[This message has been edited by VoodooMill (edited 06-27-2000).]

[This message has been edited by VoodooMill (edited 06-27-2000).]


VoodooMill
Deleted

Jun 27, 2000, 3:11 PM

Post #2 of 2 (443 views)
Re: How do I remove a file? [In reply to] Can't Post

Never mind, I figured it out. It took me a couple days, but I got it. Just a little disappointed my first post here went ignored. I was hoping this would be a good place to come for help. Oh well. Take it easy.

VoodooMill.....

[This message has been edited by VoodooMill (edited 06-29-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives