Results 1 to 4 of 4
Hi All,
Using C++, I want to process sub-folders on my home folder sequentially each with a special naming format and containing some binary files in it:
Code:
1/
2/
...
- 04-16-2010 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
detecting newly created folders/files on local file system
Hi All,
Using C++, I want to process sub-folders on my home folder sequentially each with a special naming format and containing some binary files in it:
Give above folders, I will process files in 1/ at first, 2/ at second, 3/ at third, and so on.Code:1/ 2/ 3/ 4/ 5/ 6/ ...
For some n/ folder, if I realize that n/ actually does not exist in local file system, I do not want to wait for it. Hence I will keep processing (n+1)/ folder, and so on.
However, when processing some (n+m)/ folder, previously not processed n/ folder may have been created on local file system. In this case, I do not want to miss processing it, but somehow detect its creation and process it. After processing n/ folder, I want to continue from (n+m+1)/.
How can I do this in Linux ?
What kind of architecture should I use ?
Thanks.
- 04-16-2010 #2
There's a set of functions called inotify that will do that for you. It's actually something that the kernel does as a service to processes that ask for it.
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 04-19-2010 #3Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
- 04-20-2010 #4
FAM is a daemon that provides notify services for programs in general. I believe it uses inotify to get the information. If a program uses inotify directly, you don't need to have FAM running. I can't tell you which one is better because I've never used either. Hopefully someone else can take this thread over.
"I'm just a little old lady; don't try to dazzle me with jargon!"


Reply With Quote
