Commit 9d80c38d authored by Idir Lankri's avatar Idir Lankri

Move function to split a path into subdirectories to module Dir

parent 340e24e6
......@@ -14,9 +14,7 @@ value int_of_file file =
value cmp_section_file file file' =
compare (int_of_file file) (int_of_file file')
;
value section path =
let split file = Str.split (Str.regexp Filename.dir_sep) file in
List.length (split path) > 1
value section path = List.length (Dir.split path) > 1
;
value content subdir =
let cmp_subdir =
......
......@@ -17,3 +17,5 @@ value files_with_ext ext dir cmp =
let files = List.filter (file_with_ext ext) (abs_files dir) in
files |> basenames |> List.sort cmp
;
value split path = Str.split (Str.regexp Filename.dir_sep) path
;
......@@ -9,3 +9,7 @@ value subdirs : string -> (string -> string -> int) -> list string
value files_with_ext :
string -> string -> (string -> string -> int) -> list string
;
(* [split path] splits [path] into substrings corresponding to the
subdirectories of [path]. *)
value split : string -> list string
;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment