Reputation: 627
Using C++ on Windows XP, Windows 7 and Linux.
Reading the fopen documentation (http://www.cplusplus.com/reference/cstdio/fopen/) about filename:
C string containing the name of the file to be opened. Its value shall follow the file name specifications of the running environment and can include a path (if supported by the system).
What does "running environment" mean in this context? The operating system or file systems?
How do I determine what is supported filename for various platforms (without doing trial and error) ?
Upvotes: 0
Views: 196
Reputation: 14360
That means that in Windows you need to specify the path using forward slashes while in Linux/Unix backwards slashes(despite of filesystem type).
Windows example filename: C:/some_path/filename
Unix/Linux/Mac example filename: \some_path\filename
Also means that you can't violate the name spacifications for file names, for instance Windows(NTFS, FAT, ...) don't allow the use of ?
caracter while Linux does.
Hence, you can say that "running environment" here refers to both, operating system and file system.
Upvotes: 1