File paths on different platforms

BlitzMax Forums/BlitzMax Beginners Area/File paths on different platforms

Since file paths are normally specified differently on different platforms, how do we to specify a file path in a OS neutral way?

I believe the / character will work on all platforms.

As for "C:" vs. "/" I don't think there's a way (at least not one I've stumbled accross), but I would say that it's safe to assume that as long as you use relative pathnames you should be in the clear.

I know my stuff works from both "D:\Dev\BlitzMAX" and "/home/FlameDuck/Dev/BlitzMAX".

What about ../ does that work on anything but Windows?

Toby... I haven't tried it in Blitz for Linux, but I have used the same thing in php, python, on a linux system, so I would assume that is a safe bet!

For relative paths, you can use / in both Windows and other platforms.

What about ../ does that work on anything but Windows?
I can confirm this works on Linux, and I believe James once said it worked on Mac too (it should anyhoo, because the filesystem is similar - to Linux that is).

Good. That's everything you need for relative paths then, innit? ;]

../ should work in windows as well