diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-01-19 20:00:18 +0100 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-01-19 20:00:18 +0100 |
commit | 8ab5f20f532bc6e9de38ee457b0ef8dd30c80374 (patch) | |
tree | ceecccdb379a9298ca2eef7053b1887885134f8d /lib/helpers/file_helpers.ml |
Initial commit for ogit.
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>" |