updating utility to use an ifdef instead of popen

Thanks, Ben!

This returns the path separator in a safer way than was there before.