On Linux.
I want to build a buffer of files. A new file is saved every 30 minutes . But the total number of files allowed are ‘n’.
so when ‘n+1’th file is created, the oldest one has to be deleted.
I found stuff like ‘dirent.h’ and ‘struct stat’ that can help access directory, list all files and get its properties.
struct stat does not however the give time of creation, but just – last modified,last accessed, time of last status changed http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysstat.h.html
Please Help.
P.S: boost is not available right now.
On Linux there is no such thing as file creation time saved with file in file system(s) metadata. There is something close to it, but not the same: inode modification time (this is the
st_ctimemember ofstruct stat). Fromstatman page:As long as you do not modify these properties and you do not write (more than zero bytes) to a file(s) – the
st_ctimeis your “file creation time”.