object = GetFileInformationByHandleEx(File, FileInformationClass )

Retrieves extended file information for an open file handle.



Handle to a file or directory. Do not pass a pipe handle.

FileInformationClass : int

Type of data to return, one of win32file.File*Info values


Available on Vista and later.

Accepts keyword args.

Return Value

Type of returned object is determined by the requested information class

Class Returned info
FileBasicInfoDict representing a FILE_BASIC_INFO struct
FileStandardInfoDict representing a FILE_STANDARD_INFO struct
FileNameInfoString containing the file name, without the drive letter
FileCompressionInfoDict representing a FILE_COMPRESSION_INFO struct
FileAttributeTagInfoDict representing a FILE_ATTRIBUTE_TAG_INFO struct
FileIdBothDirectoryInfoSequence of dicts representing FILE_ID_BOTH_DIR_INFO structs. Call in loop until no more files are returned.
FileIdBothDirectoryRestartInfoSequence of dicts representing FILE_ID_BOTH_DIR_INFO structs.
FileStreamInfoSequence of dicts representing FILE_STREAM_INFO structs