See the java.io.File class.
It has the functionality you need:
* delete()
* getAbsolutePath() (i.e., get the file name)
* lastModified() (i.e., get the date the file was last modified)
FYI - with lastModified(), it doesn't give you back a Date object, but a
long. You can then use this long to create a Date (i.e., new
Date(lastModified)).
HTH.
DR
At 04:45 PM 8/20/2002 +0200, you wrote:
>Hi all,
>
>I'm creating a file using new FileOutputStream(fileName) ,where fileName
>is composed of a prefix taken with System.getProperty("OutFile",
>"<file://Out/>\\Out") and the suffix is the current timestamp.
>
>The thing is, I want to be able to delete all files with the same prefix
>that are older than X days (where X is also a parameter).
>
>How do I do that?
>
>Thanks,
>
>Ron Sher
>
>To change your membership options, refer to:
>http://www.sys-con.com/java/list.cfm
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm