It's not a secret anymore!
The moose likes Java in General and the fly likes How to Read the Time Stamp of a File Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to Read the Time Stamp of a File" Watch "How to Read the Time Stamp of a File" New topic
Author

How to Read the Time Stamp of a File

Vijay Kumar koganti
Ranch Hand

Joined: Jan 23, 2006
Posts: 53
Hi all,

I would like to develop a code which should be able to Retrieve the Time Stamps of the LOg Files(8-10) files and it needs to check that time stamp with the current Time stamp and if it is Less than a defined Limit it needs to Write a Error Log if not needs to Write a Success S.O.P stating the Time stamp of that File + Current Time Stamp, and all these should be logged into a Text File at a defined location.

Can some one guide me through the process..

Thanks in Advance,
vijay kumar k.


vijay kumar k.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16815
    
  19

Take a peek at the JavaDoc for the File Class. This class allows you to get the time that file was last modified -- which I am assuming is what you meant by timestamp.

Henry
[ July 04, 2006: Message edited by: Henry Wong ]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ray Thibeault
Greenhorn

Joined: Jul 25, 2012
Posts: 3
Thanks, I was looking for this but somehow I thought it would start with "get".
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to Read the Time Stamp of a File
 
Similar Threads
Shell Script For Getting List Of File name In A directory
when does log4j change log file name ?
NX: concerning logging
How to select specificied parts of a file to decrypt
Log size and backup