Guidelines

Each file system consists of one or more drivers and supporting dynamic-link libraries that define the data formats and features of the file system. These determine the conventions used for filenames, the level of security and recoverability available, and the general performance of input and output (I/O) operations. Before you access files and directories on a given volume, you should determine the capabilities of the file system by using the GetVolumeInformation function. The function returns values, such as the maximum length of filenames, that you can use to adapt your application to work effectively with the file system.

In general, you should always avoid using static buffers for filenames 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 filenames and 260 characters for paths. These are the maximums currently recommended for Win32-based applications.