First, I want to start by using inotify to monitor a specific directory (main directory) for files and subdirectories. If a new directory is added to this main directory, how could I track this subdirectory using inotify? How can I track the new directory in this subdirectory of the main directory?
I think that adding it to the watch is easy using the inotify_add_watch() function, but I donโt know how to get the correct relative path to files and directories in subdirectories (use for similar synchronization with Dropbox to another location while maintaining the correct directory tree, for example) .
source share