I have a program in python 2.7 that is writing certain files and directories base on user input. I need to make sure that the files and directories are valid for both linux and windows as the files will be exchanged through the two operating systems. The files will originally be created in linux and manual moved to windows.
I have checked through Python docs, stack exchange, and several pages of google without turning up any usable information which is strange because I would imagine this would be a fairly common issue.
Is there an easy solution?
Edit: I would like to validate the directory-filename incase a user enters a path that does not work for linux or windows. As an example if a user enters "Folder1/This:Error/File.txt" the program will see this as an error.
The program will run in Linux and write the files in linux but later the files will be moved to windows. The differences in forward/back-slashes is a non-issue, but other characters that may work for linux but not windows would present a problem.
Also, often times the files or directories will not be present (as they are about to be created) so I need to check that path, held in a string, would be a valid path.