0

Does Linux or UNIX have an API which gives information about new file creation? I want to make a file creation watcher, to watch for file creation inside a folder that has thousand of sub folders, but with almost zero memory allocation.

  • 3
    You should read documentation on inotify. Note that it is NOT recursive, so you might need to create a watch for each subfolder. – Philip Couling May 10 at 16:07
  • @PhilipCouling that's why i need something like linux api (from syscall) – Gesy Yeze Abdullah May 10 at 16:39
  • 1
    You can find a list of syscalls here. You are unlikely to find a recursive directory watch though because watches are almost certainly created against an inode – Philip Couling May 10 at 17:11
  • inotify_init(2), inotify_add_watch(2), read(2), etc. – mosvy May 10 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.