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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/util/tstamp.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/util/tstamp.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 354 - (view) (download)

1 : blume 277 (*
2 :     * CM timestamp semantics.
3 :     *
4 :     * (C) 1999 Lucent Technologies, Bell Laboratories
5 :     *
6 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7 :     *)
8 : blume 274 structure TStamp = struct
9 :    
10 :     datatype t =
11 :     NOTSTAMP
12 :     | TSTAMP of Time.time
13 :    
14 : blume 330 val ancient = TSTAMP (Time.zeroTime)
15 :    
16 : blume 345 (* We consider a target good if it has the same time stamp
17 :     * as the source. A target that isn't there is never good,
18 :     * and if there is a target but no source, then we assume the
19 :     * target to be ok. *)
20 :     fun needsUpdate { target = NOTSTAMP, ... } = true
21 :     | needsUpdate { source = NOTSTAMP, ... } = false
22 :     | needsUpdate { source = TSTAMP st, target = TSTAMP tt } =
23 :     Time.compare (st, tt) <> EQUAL
24 : blume 354
25 :     fun fmodTime f = TSTAMP (OS.FileSys.modTime f) handle _ => NOTSTAMP
26 :     fun setTime (f, NOTSTAMP) = ()
27 :     | setTime (f, TSTAMP t) = OS.FileSys.setTime (f, SOME t)
28 : blume 274 end

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