files.mli (4345B)
1 (* Unison file synchronizer: src/files.mli *) 2 (* Copyright 1999-2020, Benjamin C. Pierce (see COPYING for details) *) 3 4 (* As usual, these functions should only be called by the client (i.e., in *) 5 (* the same address space as the user interface). *) 6 7 (* Delete the given subtree of the given replica *) 8 val delete : 9 Common.root (* source root *) 10 -> Path.t (* deleted path *) 11 -> Common.root (* root *) 12 -> Path.t (* path to delete *) 13 -> Common.updateItem (* updates that will be discarded *) 14 -> bool (* [true] if not Unison's default action *) 15 -> unit Lwt.t 16 17 (* Region used for the copying. Exported to be correctly set in transport.ml *) 18 (* to the maximum number of threads *) 19 val copyReg : Lwt_util.region ref 20 21 (* Copy a path in one replica to another path in a second replica. The copy *) 22 (* is performed atomically (or as close to atomically as the os will *) 23 (* support) using temporary files. *) 24 val copy : 25 [`Update of (Uutil.Filesize.t * Uutil.Filesize.t) | `Copy] 26 (* whether there was already a file *) 27 -> Common.root (* from what root *) 28 -> Path.t (* from what path *) 29 -> Common.updateItem (* source updates *) 30 -> Props.t list (* properties of parent directories *) 31 -> Common.root (* to what root *) 32 -> Path.t (* to what path *) 33 -> Common.updateItem (* dest. updates *) 34 -> Props.t list (* properties of parent directories *) 35 -> bool (* [true] if not Unison's default action *) 36 -> Uutil.File.t (* id for showing progress of transfer *) 37 -> unit Lwt.t 38 39 (* Copy the permission bits from a path in one replica to another path in a *) 40 (* second replica. *) 41 val setProp : 42 Common.root (* source root *) 43 -> Path.t (* source path *) 44 -> Common.root (* target root *) 45 -> Path.t (* target path *) 46 -> Props.t (* previous properties *) 47 -> Props.t (* new properties *) 48 -> Common.updateItem (* source updates *) 49 -> Common.updateItem (* target updates *) 50 -> unit Lwt.t 51 52 (* Generate a difference summary for two (possibly remote) versions of a *) 53 (* file and send it to a given function *) 54 val diff : 55 Common.root (* first root *) 56 -> Path.t (* path on first root *) 57 -> Common.updateItem (* first root updates *) 58 -> Common.root (* other root *) 59 -> Path.t (* path on other root *) 60 -> Common.updateItem (* target updates *) 61 -> (string->string->unit) (* how to display the (title and) result *) 62 -> Uutil.File.t (* id for showing progress of transfer *) 63 -> unit 64 65 (* This should be called at the beginning of execution, to detect and clean *) 66 (* up any pending file operations left over from previous (abnormally *) 67 (* terminated) synchronizations *) 68 val processCommitLogs : unit -> unit 69 70 (* List the files in a directory matching a pattern. *) 71 val ls : string -> string -> string list 72 73 val merge : 74 Common.root (* first root *) 75 -> Path.t (* path to merge *) 76 -> Common.updateItem (* differences from the archive *) 77 -> Common.root (* second root *) 78 -> Path.t (* path to merge *) 79 -> Common.updateItem (* differences from the archive *) 80 -> Uutil.File.t (* id for showing progress of transfer *) 81 -> (string->string->bool) (* function to display the (title and) result 82 and ask user for confirmation (when -batch 83 is true, the function should not ask any 84 questions and should always return true) *) 85 -> unit