日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

ReadDirectoryChangesW 函数

發(fā)布時(shí)間:2023/11/29 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ReadDirectoryChangesW 函数 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
ReadDirectoryChangesW 函數(shù)

ReadDirectoryChangesW 函數(shù)

對(duì)指定的目錄進(jìn)行監(jiān)控,返回詳細(xì)的文件變化信息。

函數(shù)形式

01?BOOL?WINAPI?ReadDirectoryChangesW(
02?__in?????????HANDLE?hDirectory,???// 對(duì)目錄進(jìn)行監(jiān)視的句柄
03?__out??????? LPVOID?lpBuffer,?????// 一個(gè)指向DWORD類型的緩沖區(qū),其中可以將獲取的數(shù)據(jù)結(jié)果將其返回。
04?__in???????? DWORD?nBufferLength,?// 指lpBuffer的緩沖區(qū)的大小值,以字節(jié)為單位。
05?__in???????? BOOL?bWatchSubtree,?// 監(jiān)視目錄. 一般選擇 TRUE
06?__in???????? DWORD?dwNotifyFilter,?// 對(duì)文件過濾的方式和標(biāo)準(zhǔn)
07?__out_opt??? LPDWORD?lpBytesReturned,?// 將接收的字節(jié)數(shù)轉(zhuǎn)入lpBuffer參數(shù)
08?__inout_opt?LPOVERLAPPED?lpOverlapped,?// 一般選擇 NULL
09?__in_opt???? LPOVERLAPPED_COMPLETION_ROUTINE?lpCompletionRoutine?// 一般選擇 NULL
10?);

1.hDirectory [中]

?????? This directory must be opened with the FILE_LIST_DIRECTORY access right.
?????? 被監(jiān)視的目錄必須打開FILE_LIST_DIRECTORY的訪問權(quán)限
???????
2.lpBuffer[中]

?????? The structure of this buffer is defined by the FILE_NOTIFY_INFORMATION structure
?????? 這個(gè)緩沖區(qū)的定義是FILE_NOTIFY_INFORMATION結(jié)構(gòu)。
?????? This buffer is filled either synchronously or asynchronously,?
?????? depending on how the directory is opened and what value is given to the lpOverlapped parameter.
?????? 這個(gè)緩沖區(qū)充滿要么同步或異步,這取決于如何打開目錄什么價(jià)值給予lpOverlapped參數(shù)。

3.nBufferLength [中]?
???????
?????? The size of the buffer that is pointed to by the lpBuffer parameter, in bytes.
?????? 大小的緩沖區(qū),是指出的lpBuffer參數(shù),以字節(jié)為單位。

4.bWatchSubtree [中]

?????? If this parameter is TRUE, the function monitors the directory tree rooted at the specified directory.
?????? 如果這個(gè)參數(shù)是TRUE,那么這個(gè)函數(shù)會(huì)監(jiān)視目錄樹,所指定的當(dāng)前的根目錄(整個(gè)路徑信息都顯示出來)。

?????? If this parameter is FALSE, the function monitors only the directory specified by the hDirectory parameter.
?????? 如果這個(gè)參數(shù)是FALSE ,則函數(shù)則只監(jiān)視hDirectory句柄所指定的目錄下的內(nèi)容(只顯示出發(fā)生變化的文件目錄)。?
???????
5.dwNotifyFilter [中]

?????? The filter criteria that the function checks to determine if the wait operation has completed.
?????? 該過濾器的標(biāo)準(zhǔn),功能檢查,以決定是否等待操作完成。?
?????? This parameter can be one or more of the following values.這個(gè)參數(shù)可以是一個(gè)或多個(gè)下列值。?
?????????
??????【FILE_NOTIFY_CHANGE_FILE_NAME】 0x00000001
?????? Any file name change in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何文件名改變 都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。?
?????? Changes include renaming, creating, or deleting a file.
?????? 變化包括重命名,創(chuàng)建或刪除文件。?

??????【FILE_NOTIFY_CHANGE_DIR_NAME】 0x00000002?
?????? Any directory-name change in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何目錄名稱改變 都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。
?????? Changes include creating or deleting a directory.
?????? 改變包括建立或刪除一個(gè)目錄。?

??????【FILE_NOTIFY_CHANGE_ATTRIBUTES】 0x00000004?
?????? Any attribute change in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何屬性變化,都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。

??????【FILE_NOTIFY_CHANGE_SIZE】 0x00000008?
?????? Any file-size change in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何文件大小的變化,都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。?
?????? The operating system detects a change in file size only when the file is written to the disk.
?????? 操作系統(tǒng)檢測改變文件大小,只有當(dāng)該文件被寫入到磁盤時(shí)發(fā)生。?
?????? For operating systems that use extensive caching, detection occurs only when the cache is sufficiently flushed.
?????? 操作系統(tǒng)使用廣泛緩存,檢測時(shí)才會(huì)發(fā)生的緩存足夠同滿。

??????【FILE_NOTIFY_CHANGE_LAST_WRITE】0x00000010?
?????? Any change to the last write-time of files in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何改變過去修改時(shí)間的文件 ,都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。
?????? The operating system detects a change to the last write-time only when the file is written to the disk.
?????? 操作系統(tǒng)檢測改變過去寫的時(shí)間只有當(dāng)該文件被寫入到磁盤。?
?????? For operating systems that use extensive caching, detection occurs only when the cache is sufficiently flushed.
?????? 操作系統(tǒng)使用廣泛緩存,檢測時(shí)才會(huì)發(fā)生的緩存足夠同滿。?

??????【FILE_NOTIFY_CHANGE_LAST_ACCESS】0x00000020?
?????? Any change to the last access time of files in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何改變文件最近訪問時(shí)間,都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。

??????【FILE_NOTIFY_CHANGE_CREATION】 0x00000040?
?????? Any change to the creation time of files in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何改變文件的創(chuàng)建時(shí)間的,都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。

??????【FILE_NOTIFY_CHANGE_SECURITY】0x00000100?
?????? Any security-descriptor change in the watched directory or subtree causes a change notification wait operation to return.
?????? 任何安全描述符被改變的,都會(huì)查看所在目錄或子目錄的變更,并將結(jié)果通知給等待操作返回。

6.lpBytesReturned [了,可選]?

?????? For synchronous calls, this parameter receives the number of bytes transferred into the lpBuffer parameter.
?????? 同步調(diào)用,這個(gè)參數(shù)接收的字節(jié)數(shù)轉(zhuǎn)入lpBuffer參數(shù)。?
?????? For asynchronous calls, this parameter is undefined.
?????? 異步調(diào)用,這個(gè)參數(shù)是未定義的。?
?????? You must use an asynchronous notification technique to retrieve the number of bytes transferred.
?????? 您必須使用異步通知技術(shù)檢索的字節(jié)數(shù)轉(zhuǎn)移。

7.lpOverlapped [中,那樣,可選]?
????????
?????? A pointer to an OVERLAPPED structure that supplies data to be used during asynchronous operation.
?????? 一個(gè)指針的重疊結(jié)構(gòu),提供供數(shù)據(jù)時(shí)使用的異步操作。?
???????
?????? Otherwise, this value is NULL.
?????? 否則,這個(gè)值為NULL 。?
???????
?????? The Offset and OffsetHigh members of this structure are not used.?
?????? OFFSET和OffsetHigh成員結(jié)構(gòu)不使用。

8.lpCompletionRoutine [中,可選]?

?

?????? A pointer to a completion routine to be called when the operation has been completed or canceled and the calling?
?????? thread is in an alertable wait state.
?????? 一個(gè)指針一個(gè)完成例程 如果在呼叫使用函數(shù)操作時(shí)已經(jīng)完成或取消和調(diào)用線程是在alertable等待狀態(tài)。
???????
返回值

?????? If the function succeeds, the return value is nonzero.
?????? 如果函數(shù)成功,返回值為非零。

?????? For synchronous calls, this means that the operation succeeded.
?????? 同步要求,這意味著操作取得了成功。

?????? For asynchronous calls, this indicates that the operation was successfully queued.
?????? 異步調(diào)用,這表明操作成功排隊(duì)。

If the function fails, the return value is zero.
如果函數(shù)失敗,返回值是零。

To get extended error information, call GetLastError .
要獲得擴(kuò)展錯(cuò)誤信息,請(qǐng)用GetLastError返回錯(cuò)誤 。

If the network redirector or the target file system does not support this operation, the function fails with ERROR_INVALID_FUNCTION.
如果網(wǎng)絡(luò)重定向或目標(biāo)文件系統(tǒng)不支持這一行動(dòng),該功能失敗, ERROR_INVALID_FUNCTION 。

hat the operation succeeded.
?????? 同步要求,這意味著操作取得了成功。

?????? For asynchronous calls, this indicates that the operation was successfully queued.
?????? 異步調(diào)用,這表明操作成功排隊(duì)。

If the function fails, the return value is zero.
如果函數(shù)失敗,返回值是零。

To get extended error information, call GetLastError .
要獲得擴(kuò)展錯(cuò)誤信息,請(qǐng)用GetLastError返回錯(cuò)誤 。

If the network redirector or the target file system does not support this operation, the function fails with ERROR_INVALID_FUNCTION.
如果網(wǎng)絡(luò)重定向或目標(biāo)文件系統(tǒng)不支持這一行動(dòng),該功能失敗, ERROR_INVALID_FUNCTION 。

posted on 2011-12-01 14:36 流沙- 閱讀(...) 評(píng)論(...) 編輯 收藏

轉(zhuǎn)載于:https://www.cnblogs.com/darkdance/archive/2011/12/01/2270555.html

總結(jié)

以上是生活随笔為你收集整理的ReadDirectoryChangesW 函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。