Platform SDK: Files and I/O |
Depending on the configuration of a computer, a Win32®-based application may have access to volumes managed by any of the following file systems: NTFS, FAT, or protected-mode FAT. Because the different volumes your application connects to can be managed by different file systems, it is important to understand the differences between file systems and to prepare your application to work effectively with all file systems.
Note 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. Therefore, the GetFileTime function may not return the same file time information set using the SetFileTime function. Furthermore, FAT records times on disk in local time. However, NTFS records times on disk in UTC, so it is not affected by changes in time zone or daylight saving time.
Before you access files and directories on a given volume, you should determine the capabilities of the file system by using the GetVolumeInformation function. This function returns values that you can use to adapt your application to work effectively with the file system.
In general, you should avoid using static buffers for file names and paths. Instead, use the values returned by GetVolumeInformation to allocate buffers as you need them. If you must use static buffers, reserve 256 characters for file names and 260 characters for paths.
This overview describes the following: