path_***


path_extension(path) 
path_strip_extension(path) 
path_directory(path) 
path_strip_directory(path) 
path_strip_trailing_directory_separator(path) 
path_volume(path) 
path_strip_volume(path)           
      

Return the various components of path.

The function path_volume returns the file's volume (including the last path separator) or the empty string if no volume is specified in the path. Path_volume and path_strip_volume will be useful on platforms like Microsoft® Windows®, where paths can be specified with volumne, for e.g "C:/tmp.txt" where "C:/" is the volume.

Examples:


let p = "/user/me/projects/slogan/README.md"
path_extension(p)
// .md
path_strip_extension(p)
// /user/me/projects/slogan/README
path_directory(p)
// /user/me/projects/slogan/
path_strip_directory(p)
// README.md
path_strip_trailing_directory_separator(path_directory(p))
// /user/me/projects/slogan
      

Also see:

path_expand
path_normalize
current_directory


Core Module Index | Contents