• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the file reciving time from unix box  RSS feed

 
ravi kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Any body please tell me the procedure to get the files and file reciving time from the unix box.I am Waiting for your reply.Thanks in advance.
Thanks & Regards
Ravi kumar
 
M Anderson
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not exactly sure what you're asking, but you should be able to get the file's timestamp by calling the lastModified() method on the java.io.File object. So, like this:

import java.io.File;
...

File f = new File("somepath/somefile.txt");
if (f.exists()) {
long timestamp = f.lastModified();
// do whatever with that long, like create a java.util.Date and go
// from there...
}
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!