on_after_enumerate_directory Event
Fires after a directory entry is returned during directory enumeration.
Syntax
class CBFilterAfterEnumerateDirectoryEventParams(object): @property def directory_name() -> str: ... @property def file_name() -> str: ... @property def creation_time() -> datetime.datetime: ... @creation_time.setter def creation_time(value) -> None: ... @property def last_access_time() -> datetime.datetime: ... @last_access_time.setter def last_access_time(value) -> None: ... @property def last_write_time() -> datetime.datetime: ... @last_write_time.setter def last_write_time(value) -> None: ... @property def change_time() -> datetime.datetime: ... @change_time.setter def change_time(value) -> None: ... @property def size() -> int: ... @size.setter def size(value) -> None: ... @property def allocation_size() -> int: ... @allocation_size.setter def allocation_size(value) -> None: ... @property def file_id() -> int: ... @file_id.setter def file_id(value) -> None: ... @property def attributes() -> int: ... @attributes.setter def attributes(value) -> None: ... @property def status() -> int: ... @status.setter def status(value) -> None: ... @property def directory_context() -> int: ... @directory_context.setter def directory_context(value) -> None: ... @property def handle_context() -> int: ... @handle_context.setter def handle_context(value) -> None: ... @property def enumeration_context() -> int: ... @enumeration_context.setter def enumeration_context(value) -> None: ... @property def process_request() -> bool: ... @process_request.setter def process_request(value) -> None: ... @property def result_code() -> int: ... @result_code.setter def result_code(value) -> None: ... # In class CBFilter: @property def on_after_enumerate_directory() -> Callable[[CBFilterAfterEnumerateDirectoryEventParams], None]: ... @on_after_enumerate_directory.setter def on_after_enumerate_directory(event_hook: Callable[[CBFilterAfterEnumerateDirectoryEventParams], None]) -> None: ...
Remarks
This event fires after a directory entry (i.e., a file or subdirectory) is returned during enumeration of the directory specified by DirectoryName.
Applications may use this event to modify the entry's metadata before it gets reported to the requestor, or even prevent the entry from being reported in the first place.
Applications only need to handle this event if they've added a standard filter rule that includes the FS_CE_AFTER_ENUMERATE_DIRECTORY flag.
The FileName parameter reflects the name of the directory entry.
The CreationTime, LastAccessTime, LastWriteTime, and ChangeTime parameters specify the entry's time values, specified in UTC.
The Size parameter specifies the size of the file, in bytes; it must always be 0 for subdirectories.
The AllocationSize parameter specifies the amount of space allocated for the file, in bytes; it must always be 0 for subdirectories.
The FileId parameter specifies the unique Id of the entry, as reported by the filesystem (or, for virtual files, by the application itself). This Id is used by the network redirector, and some third-party applications, to open files and directories by Id instead of by name. The root directory always uses the predefined Id 0x7FFFFFFFFFFFFFFF.
The Attributes parameter specifies the entry's attributes; please refer to Microsoft's File Attribute Constants article for attribute descriptions.
The Status parameter contains an NT status code that indicates the outcome of the operation; 0 indicates success. To convert this value to a Win32 error code, call the nt_status_to_win_32_error method. Please note that this event won't fire for failed requests unless the process_failed_requests property is enabled. Applications may change this parameter's value if they want a different NT status code to be returned.
The DirectoryContext, HandleContext, and EnumerationContext parameters are placeholders for application-defined data associated with the directory, specific handle, and enumeration; respectively. (For general-purpose events, the DirectoryContext is called FileContext instead.) DirectoryContext corresponds to the FileContext in the file/directory creation, opening, and closing events. Please refer to the Contexts topic for more information.
The ProcessRequest parameter controls whether the directory entry should actually be reported to the requestor; it is True by default. Setting this parameter to False will "hide" the directory entry (i.e., prevent it from being reported).
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.