hi,
I want to delete files older than a particular date or older than a particular no of days.
the command i used for this is on a usual linux machine was- find /dir -type f -mtime +7 | xargs rm -f
( also i used a combination of "touch" and "find" which too worked fine)
now my problem is i have to perform the same task only in C (without using shell script ) as the device for which i m writing this module has its own small linux kernel and hence doesnt support many commnads like "find" , "more" ,"mv" etc ..........
i am aware of the remove() function in C but how do i get the date a file was last modified and then delete it ???
Any solution / suggestions will b of great help to me ........... thnx ..........
--------------------------------- Everyone is raving about the all-new Yahoo! Mail beta.
Hi,
What you are looking for are POSIX functions: opendir - open a directory readdir - read a directory stat, fstat, lstat - get file status remove - delete a name and possibly the file it refers to unlink - remove a directory entry rmdir - remove a directory closedir - close a directory
manoj
Manoj Srivastava srivasta@debian.org wrote: Hi,
What you are looking for are POSIX functions: opendir - open a directory readdir - read a directory stat, fstat, lstat - get file status remove - delete a name and possibly the file it refers to unlink - remove a directory entry rmdir - remove a directory closedir - close a directory
manoj