diff options
Diffstat (limited to 'lib/helpers/file_helpers.ml')
-rw-r--r-- | lib/helpers/file_helpers.ml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/helpers/file_helpers.ml b/lib/helpers/file_helpers.ml new file mode 100644 index 0000000..892d807 --- /dev/null +++ b/lib/helpers/file_helpers.ml @@ -0,0 +1,7 @@ +let list_files dir = + try + Array.to_list (Sys.readdir dir) + |> List.map (fun file -> Printf.sprintf "<li>%s</li>" file) + |> String.concat "" + with _ -> + "<li>Error: Unable to read directory</li>" |