Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: delete old files (windoze)

by xorl (Deacon)
on Oct 15, 2004 at 13:55 UTC ( #399504=note: print w/replies, xml ) Need Help??

in reply to delete old files (windoze)

This is how I do it.
use File::Find; find(\&wanted, $dir); sub wanted { unlink $_ if -M $_ > $days; }
$dir is the directory you want to delete files from
$days is how old the files are. i.e. if you wanted to delete all files older than two weeks set days to 14.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://399504]
[shmem]: python sucks
[LanX]: keep your sexlife private, please!
[LanX]: ;-p
shmem spent 3 hours chasing a bug related to variable scoping
[shmem]: is there an equivalent to my in python? or 'use strict' ?
[LanX]: I doubt
[LanX]: only nonlocal in Py3

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2018-03-20 17:48 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (256 votes). Check out past polls.