on_dir_list Event
Fired when a directory entry is received.
Syntax
class FTPDirListEventParams(object): @property def dir_entry() -> str: ... @property def file_name() -> str: ... @property def is_dir() -> bool: ... @property def file_size() -> int: ... @property def file_time() -> str: ... # In class FTP: @property def on_dir_list() -> Callable[[FTPDirListEventParams], None]: ... @on_dir_list.setter def on_dir_list(event_hook: Callable[[FTPDirListEventParams], None]) -> None: ...
Remarks
The on_dir_list events are fired when a directory listing is received as a response to a list_directory or list_directory_long call.
The on_start_transfer and on_end_transfer events mark the beginning and end of the event stream.
The DirEntry parameter contains the filename when list_directory is called, and extended file information when list_directory_long is called.
The class tries to fill out the FileName, IsDir, FileSize, and FileTime parameters when calling the list_directory_long method. Except for FileName, these parameters are empty when a short 'List Directory' is performed.
In Unix systems the date is given in two types of formats: If the date is in the last 12 months the exact time is specified and the year is omitted. Otherwise only the date and the year but not hours or minutes are given.