If the initial slash is actually necessary (which it might not be), don't hardcode it. Do what you had before to determine the path separator.