file path portability file path portability unix unix

file path portability


The / is fully supported in win32 too.

Also see this related question


Windows will generally accept either \ or /,so standardizing on / may make your problem simpler as long as you have complete control over the filenames.


Have you considered creating a "file manager" class that will handle all of the file pathing issues for you? That way in your mail application, when you're loading a data file, you can call something like this.

LoadApplicationData(FileManager.GetDataFilePath)

Then your file manager will detect the environment that it is in and return the proper file path option. That way you can also accomodate for Win32 vs. Unix locatio standards (like Program Files vs /usr or whatever) as well.