• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

getting the last access date on a file

Does java support getting a last access date on a file?

I have a windows 2000 server that I want to cleanup.

thanks in advance,

Don
0
dprice7
Asked:
dprice7
  • 3
  • 3
  • 2
  • +1
1 Solution
 
objectsCommented:
0
 
dprice7Author Commented:
Objects,

Does that equal last accessed.
I want to pick up the files that change but also the ones that are just read so I don't accidentally delete those.

thanks in advance,

Don
0
 
objectsCommented:
no it doesn't give last accessed, don't think that information is even stored by the os.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Mayank SAssociate Director - Product EngineeringCommented:
Some OSs do store it :) you'd be surprised to know that Windows does ;-) but anyway, the File class doesn't give that information.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> you'd be surprised to know that Windows does

You can't see it in Windows explorer in the 'Details' view but you can view it if you right-click on the file and view its properties.
0
 
durgaprasad_jCommented:
hi,
If you are in linux, try stat <filename>, you will get this.
If there are no inbuilt java functions , you can write a simple JNI .
try man 2 stat
      man 2 fstat
Hope this helps
0
 
dprice7Author Commented:
durgaprasad,

Windows 2000 server
0
 
dprice7Author Commented:
mayankeagle,

I need to do it with a program.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
At least Java API does not support it. Since you are on Windows (which supports telling the last accessed date of a file), I guess you will have to do some research on finding out which DLL would let you know it, and then invoke it through JNI.
0
 
durgaprasad_jCommented:
hi,
check this. In .net framework, there is a functioned names getLastAccessTime
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiodirectoryclassgetlastaccesstimetopic.asp

Hope this helps
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now