unison

Fork of Unison, a bi-directional file synchronization tool
git clone git://git.laack.co/unison.git
Log | Files | Refs | README | LICENSE

os.mli (2432B)


      1 (* Unison file synchronizer: src/os.mli *)
      2 (* Copyright 1999-2020, Benjamin C. Pierce (see COPYING for details) *)
      3 
      4 val myCanonicalHostName : unit -> string
      5 
      6 val tempPath : ?fresh:bool -> Fspath.t -> Path.local -> Path.local
      7 val tempFilePrefix : string
      8 val isTempFile : string -> bool
      9 val includeInTempNames : string -> unit
     10 
     11 val exists : Fspath.t -> Path.local -> bool
     12 
     13 val createUnisonDir : unit -> unit
     14 
     15 val childrenOf : Fspath.t -> Path.local -> Name.t list
     16 val readLink : Fspath.t -> Path.local -> string
     17 val symlink : Fspath.t -> Path.local -> string -> unit
     18 
     19 val rename : string -> Fspath.t -> Path.local -> Fspath.t -> Path.local -> unit
     20 val createDir : Fspath.t -> Path.local -> int -> unit
     21 val delete : Fspath.t -> Path.local -> unit
     22 
     23 (* We define a new type of fingerprints here so that clients of
     24    Os.fingerprint do not need to worry about whether files have resource
     25    forks, or whatever, that need to be fingerprinted separately.  They can
     26    sensibly be compared for equality using =.  Internally, a fullfingerprint
     27    is a pair of the main file's fingerprint and the resource fork fingerprint,
     28    if any. *)
     29 type fullfingerprint
     30 val mfullfingerprint : fullfingerprint Umarshal.t
     31 val fullfingerprint_to_string : fullfingerprint -> string
     32 val reasonForFingerprintMismatch : fullfingerprint -> fullfingerprint -> string
     33 val fullfingerprint_dummy : fullfingerprint
     34 val fullfingerprintHash : fullfingerprint -> int
     35 val fullfingerprintEqual : fullfingerprint -> fullfingerprint -> bool
     36 
     37 (* Use this function if the file may change during fingerprinting *)
     38 val safeFingerprint :
     39   Fspath.t -> Path.local -> (* coordinates of file to fingerprint *)
     40   Fileinfo.t ->             (* old fileinfo *)
     41   fullfingerprint option -> (* fingerprint corresponding to the old fileinfo *)
     42   Fileinfo.t * fullfingerprint
     43                             (* current fileinfo, fingerprint and fork info *)
     44 val fingerprint :
     45   Fspath.t -> Path.local -> (* coordinates of file to fingerprint *)
     46   Fileinfo.typ ->           (* old fileinfo *)
     47   fullfingerprint           (* current fingerprint *)
     48 
     49 val pseudoFingerprint :
     50   Path.local             -> (* path of file to "fingerprint" *)
     51   Uutil.Filesize.t       -> (* size of file to "fingerprint" *)
     52   fullfingerprint           (* pseudo-fingerprint of this file (containing just
     53                                the file's length and path) *)
     54 
     55 val isPseudoFingerprint :
     56   fullfingerprint -> bool