944,129 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1577
  • Java RSS
Mar 28th, 2006
0

Last Edited

Expand Post »
I'm trying to find the best way to find out when a fiile was last modified and if it hasn't been modified in the last 7 days move it to a certain folder.

At the moment i'm reading in the files using a "for" loop, storing them in an array as objects. Sorry i haven't got the code on me at the moment, i remember a friend telling me there's a lastModifief() method but you can only compare it to another last modified, i'm just wondering is there any potential calendar methods i could use?

Any help is appreciated

regards
dave
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Dinosaurdave is offline Offline
1 posts
since Mar 2006
Mar 28th, 2006
0

Re: Last Edited

Hie everyone,

Quote originally posted by Dinosaurdave ...
I'm trying to find the best way to find out when a fiile was last modified and if it hasn't been modified in the last 7 days move it to a certain folder.
First compare the current date with the last modified date and if it is more than 7 days use the io classes and move it to the required folder and delete the original file

Quote originally posted by Dinosaurdave ...
i remember a friend telling me there's a lastModifief() method but you can only compare it to another last modified
There is a last modified method in the File api but you don't have to compare it to another last modified as the method returns a long.

I think your friend lied to you :cheesy:

This is the api see it for yourself

http://java.sun.com/j2se/1.4.2/docs/...a/io/File.html

This ia sample of how to use the last modified method

http://www.rgagnon.com/javadetails/java-0068.html

I hope this helped you

Yours Sincerely

Richard West
***********************************************************
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: how to built an applet in java
Next Thread in Java Forum Timeline: Runtime





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC