ReadDirectoryChangesW (windows)

O

Ognen Duzlevski

Hi all,

I am new to win32 programming and was wondring if anyone can enlighten me on a question I have:

there is a win32file function I would like to use - ReadDirectoryChangesW() and its parameters are, according to
below:

----
ReadDirectoryChangesW(handle, size, bWatchSubtree, dwNotifyFilter, overlapped)

retrieves information describing the changes occurring within a directory.

Parameters:

handle : int
Handle to the directory to be monitored. This directory must be opened with the FILE_LIST_DIRECTORY access right.

size : int
Size of the buffer to allocate for the results.

bWatchSubtree : int
Specifies whether the ReadDirectoryChangesW function will monitor the directory or the directory tree. If TRUE is
specified, the function monitors the directory tree rooted at the specified directory. If FALSE is specified, the
function monitors only the directory specified by the hDirectory parameter.

dwNotifyFilter : int
Specifies filter criteria the function checks to determine if the wait operation has completed. This parameter can be
one or more of the FILE_NOTIFY_CHANGE_* values.

overlapped=None : PyOVERLAPPED
Must be None
------

I would like to use this function asynchronously to open a directory using the FILE_FLAG_OVERLAPPED flag so that I can
later on wait for a change to be signalled and so that I can use this in a service waiting with e.g.
WaitForSingleObject().

I don't have much experience using pywin32 and I am puzzled by the last line "Must be None". Does this mean
asynchronous access is not supported? Or am I ready to actually RTFM if someone can politely point me to one? :)

Thanks,
Ognen
 
M

Mark Hammond

Ognen said:
Hi all,

I am new to win32 programming and was wondring if anyone can enlighten me on a question I have:

there is a win32file function I would like to use - ReadDirectoryChangesW() and its parameters are, according to
below:

----
ReadDirectoryChangesW(handle, size, bWatchSubtree, dwNotifyFilter, overlapped)

retrieves information describing the changes occurring within a directory.

Parameters:

handle : int
Handle to the directory to be monitored. This directory must be opened with the FILE_LIST_DIRECTORY access right.

size : int
Size of the buffer to allocate for the results.

bWatchSubtree : int
Specifies whether the ReadDirectoryChangesW function will monitor the directory or the directory tree. If TRUE is
specified, the function monitors the directory tree rooted at the specified directory. If FALSE is specified, the
function monitors only the directory specified by the hDirectory parameter.

dwNotifyFilter : int
Specifies filter criteria the function checks to determine if the wait operation has completed. This parameter can be
one or more of the FILE_NOTIFY_CHANGE_* values.

overlapped=None : PyOVERLAPPED
Must be None
------

I would like to use this function asynchronously to open a directory using the FILE_FLAG_OVERLAPPED flag so that I can
later on wait for a change to be signalled and so that I can use this in a service waiting with e.g.
WaitForSingleObject().

I don't have much experience using pywin32 and I am puzzled by the last line "Must be None". Does this mean
asynchronous access is not supported? Or am I ready to actually RTFM if someone can politely point me to one? :)

I'm afraid it is not yet supported. Patches gratefully accepted (and I
am willing to help) :)

Mark.
 
O

Ognen Duzlevski

I'm afraid it is not yet supported. Patches gratefully accepted (and I
am willing to help) :)

I am willing to work on this if I am pointed in the right direction :). I checked out the code in win32file.i and it
suggests to look at ReadFile(). I think I can come up with something.
Ognen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,500
Latest member
ArianneJsb

Latest Threads

Top