Platform SDK: Win32 API |
Long file names, file last access date, and file creation date and time are not supported while the file system is in single MS-DOS application mode. They are not supported either in versions of MS-DOS that only use the real-mode FAT file system. These file systems and others that do not support long file names are referred to as down-level systems. If you intend for an application to run with both Windows 95/98 and down-level systems, you should always check the system to determine whether it supports the long file name functions. The easiest way to check is to call Get Volume Information (Interrupt 21h Function 71A0h). This function returns an error if the system does not support the long file name functions.
Another way of handling down-level systems is to use a combination of calls to long file name and standard MS-DOS functions to carry out file management. In this case, you call the standard function only if the long file name function is not supported. To indicate an unsupported function, the system sets the AL register to zero but leaves the AH register and the carry flag unchanged. The following example shows how to combine long file name and standard functions to carry out a file or directory management operation.
stc ; set carry for error flag ; set registers here for LFN function call int 21h ; call long file name function jnc success ; call succeeded, continue processing cmp ax, 7100h ; is call really not supported? jne failure ; supported, but error occurred ; set registers here for MS-DOS function call int 21h ; call standard MS-DOS function
Application developers have to decide what to do when users save a file with a long file name to a down-level system. One approach is to imitate the behavior of the command interpreter (COMMAND.COM) and save the file using the alias without informing the user. A different approach is to have the application inform the user that the file system does not support long file names and allow the user to save the file with a file name in the standard 8.3 format.