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