Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/paths/abspath.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/paths/abspath.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 324, Wed Jun 9 07:57:07 1999 UTC revision 330, Sat Jun 12 07:45:52 1999 UTC
# Line 26  Line 26 
26      val native : { context: context, spec: string } -> t      val native : { context: context, spec: string } -> t
27      val standard : PathConfig.mode -> { context: context, spec: string } -> t      val standard : PathConfig.mode -> { context: context, spec: string } -> t
28    
29      val pickle : t -> string list      val pickle : (string -> unit) -> t -> string list
30      val unpickle : PathConfig.mode -> string list -> t option      val unpickle : PathConfig.mode -> string list * context -> t option
31    
32      val joinDirFile : { dir: t, file: string } -> t      val joinDirFile : { dir: t, file: string } -> t
33      val splitDirFile : t -> { dir: t, file: string }      val splitDirFile : t -> { dir: t, file: string }
# Line 36  Line 36 
36    
37      val exists : t -> bool      val exists : t -> bool
38      val tstamp : t -> TStamp.t      val tstamp : t -> TStamp.t
     val stabletstamp : t -> TStamp.t  
39    
40      (* The open?Out functions automagically create any necessary directories      (* The open?Out functions automagically create any necessary directories
41       * and announce this activity via their string consumer argument. *)       * and announce this activity via their string consumer argument. *)
# Line 237  Line 236 
236          end          end
237    
238          (* make a pickle-string *)          (* make a pickle-string *)
239          fun pickle p = let          fun pickle warn_nonanchor (PATH { context, spec, ... }) = let
240              fun p_p (PATH { context, spec, ... }) = spec :: p_c context              fun p_c (CONFIG_ANCHOR { config_name = n, ... }) = [n, "a"]
241              and p_c (CUR _) = ["c"]                | p_c _ = (warn_nonanchor spec; ["c"])
               | p_c (CONFIG_ANCHOR { config_name = n, ... }) = [n, "a"]  
               | p_c (RELATIVE p) = p_p p  
242          in          in
243              p_p p              spec :: p_c context
244          end          end
245    
246          fun unpickle mode l = let          fun unpickle mode (l, context) = let
247              exception Format              exception Format
248              fun u_p (h :: t) =              fun u_p (h :: t) =
249                  PATH { context = u_c t, spec = h, cache = ref NONE }                  PATH { context = u_c t, spec = h, cache = ref NONE }
250                | u_p [] = raise Format                | u_p [] = raise Format
251              and u_c ["c"] = cwdContext ()              and u_c ["c"] = context
252                | u_c [n, "a"] =                | u_c [n, "a"] =
253                  (case PathConfig.configAnchor mode n of                  (case PathConfig.configAnchor mode n of
254                       NONE => raise Format                       NONE => raise Format
255                     | SOME fetch => CONFIG_ANCHOR { fetch = fetch,                     | SOME fetch => CONFIG_ANCHOR { fetch = fetch,
256                                                     cache = ref NONE,                                                     cache = ref NONE,
257                                                     config_name = n })                                                     config_name = n })
258                | u_c l = RELATIVE (u_p l)                | u_c _ = raise Format
259          in          in
260              SOME (u_p l) handle Format => NONE              SOME (u_p l) handle Format => NONE
261          end          end
# Line 296  Line 293 
293    
294          val exists = fileExists o name          val exists = fileExists o name
295    
296          fun tstamp0 TS p = let          fun tstamp p = let
297              val n = name p              val n = name p
298          in          in
299              if fileExists n then TS (fileModTime n) else TStamp.NOTSTAMP              if fileExists n then TStamp.TSTAMP (fileModTime n)
300                else TStamp.NOTSTAMP
301          end          end
         val tstamp = tstamp0 TStamp.TSTAMP  
         val stabletstamp = tstamp0 TStamp.STABLETSTAMP  
302    
303          fun openOut fileopener ap = let          fun openOut fileopener ap = let
304              val p = name ap              val p = name ap

Legend:
Removed from v.324  
changed lines
  Added in v.330

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0