File system polling

Apr 7, 2012 at 10:06pm
Hi,

I have to pick the files(hundreds)individually and have to edit them. All the files will be in one directory where C++ program has to poll to find for new files and edit them. Files are in same format and same extension.

Any idea how to poll the file system? Your help is appreciated.

Thanks,
Ravs.
Apr 7, 2012 at 10:33pm
A word of warning, polling the file system for changed files is very expensive. It's even worse on NTFS, which is inherently slow to begin with.

How you do it depends on the operating system.

For Windows, check out FindFirstChangeNotification
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364417%28v=vs.85%29.aspx

For Linux, check out File Alteration Monitor.
http://oss.sgi.com/projects/fam/
Apr 7, 2012 at 10:50pm
Hi,

Thanks for the reply. Its on Windows OS. I just need to poll for new files, no changes in the files. Is there any way I can achieve this using C++. Can I just copy the files in another directory, and edit one after one?

Is this cannot be done in easier way in C++?

Thanks,
Ravs.
Topic archived. No new replies allowed.