Automatically delete files after a certain date

A

Allan Martin

Hello,

Can anyone point me in the right direction to write a java program
which will delete some directories in a specific windows directory
after they are more the 14 days old.

Many thanks in advance,

Allan
 
R

Roedy Green

Can anyone point me in the right direction to write a java program
which will delete some directories in a specific windows directory
after they are more the 14 days old.

See http://mindprod.com/jgloss/file.html
to get a list of files in a directory and how to find out how old they
are and how to delete them. put it all together ... 14 days is 14 *
24 * 60 * 60 * 1000 millis.


see also http://mindprod.com/jgloss/filter.html for how to write a
Filter to let through only such files.

You might want to use the Recent filter part of my collection of
filters at http://mindprod.com/products.html#FILTER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top