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:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: November 6, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles