Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## The platform-specific path separator
- const platfPathSep =
- when defined(windows):
- '\\'
- else:
- '/'
- ## A platform-independent path
- type Path = string
- proc join*(args: varargs[Path]): Path =
- ## Join path components to create a final path
- let argsWithSeps = map(args, proc(arg: Path): Path = arg & platfPathSep)
- result = join(argsWithSeps)
- # Remove trailing separator
- result = result[0.. ^1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement