git.annexia.org
/
goals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stdlib: Implement sort function.
[goals.git]
/
src
/
utils.ml
diff --git
a/src/utils.ml
b/src/utils.ml
index
235167d
..
d1b0efa
100644
(file)
--- a/
src/utils.ml
+++ b/
src/utils.ml
@@
-21,6
+21,9
@@
open Printf
let failwithf fs = ksprintf failwith fs
let failwithf fs = ksprintf failwith fs
+let (//) = Filename.concat
+let is_directory d = try Sys.is_directory d with Sys_error _ -> false
+
(* From OCaml 4.08 sources. We can remove this when we can
* depend on min OCaml 4.08.
*)
(* From OCaml 4.08 sources. We can remove this when we can
* depend on min OCaml 4.08.
*)
@@
-79,3
+82,6
@@
let trimr ?(test = isspace) str =
let trim ?(test = isspace) str =
trimr ~test (triml ~test str)
let trim ?(test = isspace) str =
trimr ~test (triml ~test str)
+
+let absolute_path path =
+ if not (Filename.is_relative path) then path else Sys.getcwd () // path