Handle cross-platform paths and paths with spaces