Module Topkg.Fpath
File system paths.
Note. Only use "/" as a directory separator, even on Windows platforms.
File system paths
type t= fpathThe type for file system paths.
val append : t -> t -> tappend p qappendsqtopas follows:- If
qis absolute thenqis returned - Otherwise appends
q's segments topusing a"/"if needed.
- If
val is_dir_path : t -> boolis_dir_path pistrueiffprepresents a directory. This means thatpis.,..or ends with/,/..or/..
val is_file_path : t -> boolis_file_path pisnot (is_dir_path true).
val basename : t -> stringbasename pisp's basename, the last non empty segment ofp.
val dirname : t -> stringdirname pisp's dirname,pwithout its last non empty segment.
File extensions
val get_ext : t -> stringget_ext pisp's filename extension (including the'.') or the empty string if there is no extension
val has_ext : string -> t -> boolhas_ext e pistrueiffeis a suffix ofp.