In this section, you will study how to obtain the file timestamp.
The following example shows the modification date and time of the specified file. The class Runtime provides the runtime environment. The class BufferedReader reads the file from the console and the method runtime.exec("cmd/c dir" +fname) executes the process. We have create another instance of class BufferedReader to get output from process.
Here is the code of GetFileTimestamp.java
Output will be displayed as:
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: November 6, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles