Path.Internal.Platform
Represents a platform used for parsing the strings, either Win32 or Posix.
Create or infer platforms with win32
, posix
and fromSeparator
win32 : Platform
Win32. Use when you want to hardcode platform into Path functions.
If you are unsure what platform you need, use fromSeparator
to infer it.
Path.Platform.fromString Path.Platform.win32 "c:/A/B/C.elm"
posix : Platform
Posix. Use when you want to hardcode platform into Path functions.
If you are unsure what platform you need, use fromSeparator
to infer it.
Path.Platform.fromString Path.Platform.posix "/A/B/C.elm"
fromSeparator : String -> Platform
Get platform based on a separator. This will default to Posix!
You can find the separator using Node with path.sep
,
in Python with os.path.sep
, and pass it in to Elm.
Path.Platform.fromSeparator "/" == Path.Platform.posix
Path.Platform.fromSeparator "\\" == Path.Platform.win32
Path.Platform.fromSeparator "lkjankljsAKSKJ" == Path.Platform.posix
separator : Platform -> String
The separator of a platform.
Path.Platform.separator Path.Platform.posix == "/"
Path.Platform.separator Path.Platform.win32 == "\\"
delimiter : Platform -> String
Delimiter of a platform.
Path.Platform.delimiter Path.Platform.posix == ":"
Path.Platform.delimiter Path.Platform.win32 == ";"