Results 1 to 2 of 2
hello friends,
actually i want to find oldest file in my folder whose path is given as command line argument. and after finding that file i want to delete that.
...
- 05-04-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 2
how to find oldest file in folder n delete that
hello friends,
actually i want to find oldest file in my folder whose path is given as command line argument. and after finding that file i want to delete that.
and there is also possibality that there may be more folders inside folder.
my paltform is linux -2.6.16
thanks
- 05-04-2007 #2
1. Define "the oldest file"? I mean to say, set some date/time to identify the oldest files.
2. If you want to do using C, use scandir API to fetch all the files in the directory, use fstat API to read timestamps, compare the timestamp, then delete it.---------------------------------
Registered Linux User #440311
HI2ARUN _AT_ GMAIL _DOT_ COM
---------------------------------


Reply With Quote