How to find the files being written between a time range in java in unix -


i have several files in directory , want find files written between time range. know not possible create time of file in linux.

i can work out sorting files last modified time , there simpler way ?

in case mean implicitly java solution:

in java, can use file.lastmodified() file’s last modified timestamps. method returns time in milliseconds (long value, epoch time), may format simpledateformat make human readable format.

so need this:

file folder = new file("your/path"); file[] listoffiles = folder.listfiles();  (int = 0; < listoffiles.length; i++) {     if (listoffiles[i].isfile()) {         if(listoffiles[i].lastmodified() > && listoffiles[i].lastmodified() < to){                 dosomething();         }     } } 

note: from,to of type long , represent time stamp.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -