| | |
Last Edited
![]() |
•
•
Join Date: Mar 2006
Posts: 1
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 7
Hie everyone,
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
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
***********************************************************
•
•
•
•
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.
•
•
•
•
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
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
***********************************************************
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
![]() |
Similar Threads
- media player f**k-up (Windows NT / 2000 / XP)
- Can a PHP website be edited by myself? (PHP)
- Factorial? (C++)
- IPhoto Saving Edited Images (Mac Software)
- Problems with first php file (PHP)
- Find and Replace (Database Design)
- No Posts? (DaniWeb Community Feedback)
- Mandrake Linux is a &^%$ (*nix Software)
Other Threads in the Java Forum
- Previous Thread: Accessing an Access Database using Java
- Next Thread: Runtime
| Thread Tools | Search this Thread |
6 @param actuate affinetransform android api applet application arc array automation balls binary bluetooth bold business c++ class client code codesnippet collections color compare component coordinates database defaultmethod detection doctype dragging ebook eclipse eclipsedevelopment educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework html ide ideas image ingres intersect invokingapacheantprogrammatically j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list map method methods mobile mysql netbeans nextline object parameter php pong problem producer program project projectideas recursive replaysolutions rim scanner sell server set size sms sql sun swing swt terminal threads tree web websites windows





