win32file.GetFileAttributesEx
tuple = GetFileAttributesEx(FileName, InfoLevelId , Transaction )
Retrieves attributes for a specified file or directory.
Parameters
Comments
Not all file systems can record creation and last access time and not all file systems record them in the same manner. For example, on Windows NT FAT, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (really, the access date). On NTFS, access time has a resolution of 1 hour. Furthermore, FAT records times on disk in local time, while NTFS records times on disk in UTC, so it is not affected by changes in time zone or daylight saving time.Accepts keyword arguments.
InfoLevelId | Information returned |
GetFileExInfoStandard | Tuple representing a WIN32_FILE_ATTRIBUTE_DATA struc |
Win32 API References
Return Value
The result is a tuple of:
Items
- [0] int : attributes
- File Attributes. A combination of the win32com.FILE_ATTRIBUTE_* flags.
- [1] PyTime : creationTime
- Specifies when the file or directory was created.
- [2] PyTime : lastAccessTime
- For a file, specifies when the file was last read from or written to. For a directory, the structure specifies when the directory was created. For both files and directories, the specified date will be correct, but the time of day will always be set to midnight.
- [3] PyTime : lastWriteTime
- For a file, the structure specifies when the file was last written to. For a directory, the structure specifies when the directory was created.
- [4] int/long : fileSize
- The size of the file. This member has no meaning for directories.