Mail Archives: djgpp/2001/08/27/11:37:13
On 26 Aug 2001, A. Sinan Unur wrote:
> i would like to write a program that will watch a given directory (possibly
> one that it was started in) for any file creation/deletion operations.
>
> I can do this in Windows using the code snippet included at the bottom of
> this post. However, I would like to use djgpp. I am assuming there is no
> similar API in the libraries, and hence I should chain some DOS interrupts.
> (I could sit in a tight loop reading directory contents but I could miss
> some creations/deletions if they happen rapidly).
Alas, AFAIK there's no way for a DOS program to plug itself into the
Windows file operations chain. I don't know about any functionality
which could allow a DOS program to register a callback for
file-oriented activities.
You could, of course, write a VxD that would export such a service,
but I doubt that you had that in mind when you asked your question.
What exactly do you want to do in this program? That is, assuming you
know some file was created or deleted, what would the program do with
that info? (It's possible that the general problem cannot be solved
with DJGPP, but some specific problem can.)
- Raw text -