Problem loading dynamic files on PC and Mac

When loading a file on PC, the location looks like this:

Directory/file.jpg

On a Mac it’s:

Directory\file.jpg

Is there a good work-around for this? Something short of adding a variable for the slash character that changes when a different OS is found?

Also, I load XML that has links in it, so changing the links on the fly after they’re loaded would be great.