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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 692 - (download) (annotate)
Thu Jul 27 08:34:53 2000 UTC (19 years ago) by blume
File size: 976 byte(s)
more assorted script enhancements
(*
 * CM timestamp semantics.
 *
 * (C) 1999 Lucent Technologies, Bell Laboratories
 *
 * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
 *)
structure TStamp = struct

    datatype t =
	NOTSTAMP
      | TSTAMP of Time.time

    val ancient = TSTAMP (Time.zeroTime)

    (* We consider a target good if it has the same time stamp
     * as the source.  A target that isn't there is never good,
     * and if there is a target but no source, then we assume the
     * target to be ok. *)
    fun needsUpdate { target = NOTSTAMP, ... } = true
      | needsUpdate { source = NOTSTAMP, ... } = false
      | needsUpdate { source = TSTAMP st, target = TSTAMP tt } =
	Time.compare (st, tt) <> EQUAL

    fun fmodTime f = TSTAMP (OS.FileSys.modTime f) handle _ => NOTSTAMP
    fun setTime (f, NOTSTAMP) = ()
      | setTime (f, TSTAMP t) = OS.FileSys.setTime (f, SOME t)

    fun max (TSTAMP t, TSTAMP t') = TSTAMP (if Time.< (t, t') then t' else t)
      | max _ = NOTSTAMP
end

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