Even though this function is alredy using system-specific code, it's still cleaner to use `SEP` and `ALTSEP` here.