Next: , Previous: , Up: parser-tools unix-pathnames   [Index]


54.1.3 Predicates for Unix pathnames

The following bindings are exported by the library (vicare parser-tools unix-pathnames).

Function: pathname? obj
Function: bytevector-pathname? obj
Function: $bytevector-pathname? bv
Function: string-pathname? obj
Function: $string-pathname? str

Return #t if obj is a string or bytevector acceptable as representation of a Unix pathname; otherwise return #f. If obj is neither string nor bytevector: return #f.

bytevector-pathname? returns #f if obj is not a bytevector. string-pathname? returns #f if obj is not a string. $bytevector-pathname? assumes that bv is a bytevector. $string-pathname? assumes that str is a string.

Function: segment? obj
Function: bytevector-segment? obj
Function: $bytevector-segment? bv
Function: string-segment? obj
Function: $string-segment? str

Return #t if obj is a string or bytevector acceptable as representation of a Unix pathname segment; otherwise return #f. If obj is neither string nor bytevector: return #f.

bytevector-segment? returns #f if obj is not a bytevector. string-segment? returns #f if obj is not a string. $bytevector-segment? assumes that bv is a bytevector. $string-segment? assumes that str is a string.

Function: list-of-segments? obj

Return #t if obj is a null or a proper list of strings and/or bytevectors each acceptable as representation of a Unix pathname segment; otherwise return #f.

Function: absolute? obj
Function: $bytevector-absolute? bv
Function: $string-absolute? str

Return #t if obj is a string or bytevector acceptable as representation of absolute Unix pathname; otherwise return #f. If obj is not a valid representation of Unix pathname: raise an exception.

$bytevector-absolute? assumes that bv satisfies the predicate bytevector-pathname?. $string-absolute? assumes that str satisfies the predicate string-pathname?.

Function: relative? obj
Function: $bytevector-relative? bv
Function: $string-relative? str

Return #t if obj is a string or bytevector acceptable as representation of absolute Unix pathname; otherwise return #f. If obj is not a valid representation of Unix pathname: raise an exception.

$bytevector-relative? assumes that bv satisfies the predicate bytevector-pathname?. $string-relative? assumes that str satisfies the predicate string-pathname?.


Next: , Previous: , Up: parser-tools unix-pathnames   [Index]