Overview  Index  Help 
SMLDoc

PATH_UTILITY

All Known Implementing Modules:

PathUtilityMain.PU


signature PATH_UTILITY =
sig
  val trPath : string -> string
  val isAbsolute : string -> bool
  val makeAbsolute : {dir : string, path : string} -> string
  val collectFilesInDir : (string -> bool) -> string -> string list
  val joinBaseExt : {base : string, ext : string option} -> string
  val joinDirFile : {dir : string, file : string} -> string
  val splitBaseExt : string -> {base : string, ext : string option}
  val splitDirFile : string -> {dir : string, file : string}
end

Utility functions for path manipulation.

Author:
YAMATODANI Kiyoshi
Copyright:
(c) 2006, Tohoku University.
Version:
$Id: SigPATH_UTILITY.html,v 1.3 2007/02/17 07:01:57 kiyoshiy Exp $

       
Value detail

trPath

val trPath : string -> string

substitute '\' in the path to '/'.


isAbsolute

val isAbsolute : string -> bool


makeAbsolute

fun makeAbsolute {dir = dir, path = path}
    : {dir : string, path : string} -> string

convert a path to its absolute form. Example.
 makeAbsolute {dir = "/foo/bar", path = "boo.sml"} ==> "/foo/bar/boo.sml"
 makeAbsolute {dir = "/foo/bar", path = "/boo.sml"} ==> "/boo.sml"
 

Parameters:
dir
the directory used as base if path is relative.
path
the path to be converted into absolute.
Returns:
absolute path equivalent to the path parameter.
Exception:
SysErr
if the file does not exist.

collectFilesInDir

val collectFilesInDir : (string -> bool) -> string -> string list


joinBaseExt

val joinBaseExt : {base : string, ext : string option} -> string


joinDirFile

val joinDirFile : {dir : string, file : string} -> string


splitBaseExt

val splitBaseExt : string -> {base : string, ext : string option}


splitDirFile

val splitDirFile : string -> {dir : string, file : string}

 


Overview  Index  Help 
SMLDoc: Documentation generator for SML