Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

How to get files files which were last used

Thread view: 
logiclips@yahoo.com - 15 Nov 2005 13:17 GMT
Hi,

is it possible to determine the files which were last used from
different applications (e.g. "readme.txt was used in the last 2 hours")
on MAC with Java by default System calls?

Or is this only possible by writing a sort of "trigger" application?

Thanks,

Peter Vermeer
abrasivesponge@gmail.com - 15 Nov 2005 13:51 GMT
All java.io.File objects have a lastModified method that returns a long
with the last time that the file was last modified.
Thomas Hawtin - 15 Nov 2005 13:52 GMT
> is it possible to determine the files which were last used from
> different applications (e.g. "readme.txt was used in the last 2 hours")
> on MAC with Java by default System calls?

There is talk of adding a Most Recently Used document feature to JDIC
(and thence to Java SE), but nothing solid yet.

http://weblogs.java.net/blog/georgez/archive/2005/07/jdicjavaone_200.html

Quite possibly someone else has come up with a Mac specific solution.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Roedy Green - 15 Nov 2005 18:21 GMT
>is it possible to determine the files which were last used from
>different applications (e.g. "readme.txt was used in the last 2 hours")
>on MAC with Java by default System calls?
>
>Or is this only possible by writing a sort of "trigger" application?

On windows, there is a Last Access date which tell the last time
anyone read/wrote the file.  Checking if it exists or checking its
date does not count as an access. You can get at it with
http://mindprod.com/products1.html#FILETIMES

You would have to implement the native method for MacOS.

I don't know if Macs maintain a last access time. It is an expensive
thing to maintain.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

logiclips@yahoo.com - 15 Nov 2005 20:28 GMT
So FileTimes gives me a list of last modified or new files independent
of the application the files came from?
For example in MS Word I change an existing file. Now I start FileTimes
which gives me back the filename?

Peter


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.