Skip to content
Snippets Groups Projects
Commit 12f3afe1 authored by Richard W.M. Jones's avatar Richard W.M. Jones
Browse files

Implement 'directory_exists' function.

parent a613a9cb
No related branches found
No related tags found
No related merge requests found
......@@ -391,6 +391,11 @@ let goal_file_exists filename =
let msg = sprintf "file '%s' required but not found" filename in
goal_failed msg
)
let goal_directory_exists path =
if not (directory_exists path) then (
let msg = sprintf "directory '%s' required but not found" path in
goal_failed msg
)
let goal_file_newer_than f1 f2 =
if not (file_newer_than f1 f2) then (
let msg = sprintf "file %s is required to be newer than %s" f1 f2 in
......
......@@ -200,6 +200,11 @@ val file_exists : string -> bool
{v require (file_exists "somefile");}
will die unless ["somefile"] exists. *)
val directory_exists : string -> bool
(** Return true if the named directory exists.
There is also a goal version of this function. *)
val file_newer_than : string -> string -> bool
(** [file_newer_than file_a file_b] returns true if [file_a] is
newer than [file_b]. Note that if [file_a] does not exist, it
......@@ -451,6 +456,7 @@ val publish : string -> (string list -> unit) -> unit
* if the predicate returns false.
*)
val goal_file_exists : string -> unit
val goal_directory_exists : string -> unit
val goal_file_newer_than : string -> string -> unit
val goal_more_recent : string list -> string list -> unit
val goal_url_exists : string -> unit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment