src/Pure/General/file.ML
changeset 73314 87403fde8cc3
parent 73264 440546ea20e6
child 75566 389b193af8ae
equal deleted inserted replaced
73313:8ae2f8ebc373 73314:87403fde8cc3
     9   val standard_path: Path.T -> string
     9   val standard_path: Path.T -> string
    10   val platform_path: Path.T -> string
    10   val platform_path: Path.T -> string
    11   val bash_path: Path.T -> string
    11   val bash_path: Path.T -> string
    12   val bash_paths: Path.T list -> string
    12   val bash_paths: Path.T list -> string
    13   val bash_platform_path: Path.T -> string
    13   val bash_platform_path: Path.T -> string
       
    14   val absolute_path: Path.T -> Path.T
    14   val full_path: Path.T -> Path.T -> Path.T
    15   val full_path: Path.T -> Path.T -> Path.T
    15   val tmp_path: Path.T -> Path.T
    16   val tmp_path: Path.T -> Path.T
    16   val exists: Path.T -> bool
    17   val exists: Path.T -> bool
    17   val rm: Path.T -> unit
    18   val rm: Path.T -> unit
    18   val is_dir: Path.T -> bool
    19   val is_dir: Path.T -> bool
    54 val bash_platform_path = Bash.string o platform_path;
    55 val bash_platform_path = Bash.string o platform_path;
    55 
    56 
    56 
    57 
    57 (* full_path *)
    58 (* full_path *)
    58 
    59 
       
    60 val absolute_path =
       
    61   Path.expand #> (fn path =>
       
    62     if Path.is_absolute path then path
       
    63     else Path.explode (ML_System.standard_path (OS.FileSys.getDir ())) + path);
       
    64 
    59 fun full_path dir path =
    65 fun full_path dir path =
    60   let
    66   let
    61     val path' = Path.expand path;
    67     val path' = Path.expand path;
    62     val _ = Path.is_current path' andalso error "Bad file specification";
    68     val _ = Path.is_current path' andalso error "Bad file specification";
    63     val path'' = dir + path';
    69   in absolute_path (dir + path') end;
    64   in
       
    65     if Path.is_absolute path'' then path''
       
    66     else Path.explode (ML_System.standard_path (OS.FileSys.getDir ())) + path''
       
    67   end;
       
    68 
    70 
    69 
    71 
    70 (* tmp_path *)
    72 (* tmp_path *)
    71 
    73 
    72 fun tmp_path path = Path.variable "ISABELLE_TMP" + Path.base path;
    74 fun tmp_path path = Path.variable "ISABELLE_TMP" + Path.base path;