DOS File Name

Using windows file naming system I can use any length of file name, but when reading the same under DOS environment the file name is converted like "abcdef~1.ext". How to read a long file name in dos using c programing.

Thanks
You can't.

DOS filenames were restricted to <8 characters> '.' <3 characters> (or the 8.3) filenames.

Windows systems on FAT32 or NTFS use the any-length filename. If you want to access the files using the "long filename" you need to use Windows functions (from the Windows API).


If you are using a modern C compiler on a Windows system you can use the native C file functions with long filenames. If you are using a pure DOS environment (no Windows, or using strict DOS emulation), or if you are using an old 16-bit compiler, then you are stuck with the short filenames.

Sorry.
Topic archived. No new replies allowed.