How to get files files which were last used  
Author Message
logiclips





PostPosted: 2005-11-15 21:18:00 Top

java-programmer, How to get files files which were last used 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





PostPosted: 2005-11-15 21:51:00 Top

java-programmer >> How to get files files which were last used 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





PostPosted: 2005-11-15 21:53:00 Top

java-programmer >> How to get files files which were last used email***@***.com wrote:
>
> 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
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
 
 
Roedy Green





PostPosted: 2005-11-16 2:22:00 Top

java-programmer >> How to get files files which were last used On 15 Nov 2005 05:17:38 -0800, email***@***.com wrote, quoted or
indirectly quoted someone who said :

>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.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
logiclips





PostPosted: 2005-11-16 4:28:00 Top

java-programmer >> How to get files files which were last used 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