linux - Find out when file was added to system or placed in directory -
on ubuntu: want able determine when file added system or in other words when placed/copied directory. time stamp 'last modified' when 1 installs apt timestamp not same when placed on system. thanks
you can use inotify
.
from manpage: "the inotify api provides mechanism monitoring filesystem events. inotify can used monitor individual files, or monitor directories."
watching file or directory change can done
int inotify_add_watch(int fd, const char *pathname, uint32_t mask);
where mask can in_modify see modifications on file/directory.
Comments
Post a Comment