How to get files files which were last used

L

logiclips

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
 
A

abrasivesponge

All java.io.File objects have a lastModified method that returns a long
with the last time that the file was last modified.
 
T

Thomas Hawtin

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
 
R

Roedy Green

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.
 
L

logiclips

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top