1 Path
:= Object clone do(
2 //metadoc Path category FileSystem
4 //doc Path hasDriveLetters returns true
if the platform requires DOS C
: style drive letters
.
5 hasDriveLetters
:= System platform
containsAnyCaseSeq("Windows") or System platform
containsAnyCaseSeq("Cygwin")
7 //doc Path
with(aSequence
) Returns a new Path object
for the given Sequence
.
10 call
message arguments
foreach(arg
,
11 v
:= call
sender doMessage(arg
)
12 //writeln("appendPathSeq(", v
type, ")")
19 //doc Path isPathAbsolute Returns true
if path is absolute
, false
if it is relative
.
20 isPathAbsolute
:= method(p
,
24 absolute
= p
at(0) isLetter
and p
at(1) asCharacter
== ":" or p
at(0) asCharacter
== "/" or p
at(0) asCharacter
== "\\"
26 absolute
= p
at(0) asCharacter
== "/"
32 //doc Path absolute Returns an absolute version of the path
.
33 absolute
:= method(path
,
34 if(isPathAbsolute(path
),
37 with(Directory currentWorkingDirectory
, path
)