Context: Our company has a suite of testing software that wasn't designed to be os-portable (i.e. it was only designed to work on Windows). Recently we've been trying to set up the testing suite and environment on my Mavericks-running Macbook Air, but again and again we're running into issues of a program looking for a file in a windows-only filepath like: C:\\folder1\\file.txt
.
Solution: Now of course the obvious way to solve this is to use sys.platform
to figure out what OS the program is running on, and then choose a corresponding filepath (if statements). But I was wondeirng if it's possible for me to set up some kind of symbolic link on my Mac, so that when the Python program looks for C:\\folder1\\file.txt
, the OS will redirect it towards ~/folder1/file.txt
, the corresponding UNIX filepath.
Is this possible? If so it would be a much faster solution then going through every file i/o in the suite and adding in if statements and UNIX friendly filepath alternatives.