https://github.com/codiepp/ml-cpp-filesystem
OCaml embedded cross-platform C++ <filesystem>
https://github.com/codiepp/ml-cpp-filesystem
cpp filesystem hacktoberfest ocaml
Last synced: 8 months ago
JSON representation
OCaml embedded cross-platform C++ <filesystem>
- Host: GitHub
- URL: https://github.com/codiepp/ml-cpp-filesystem
- Owner: CodiePP
- License: apache-2.0
- Created: 2022-08-21T13:13:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T12:06:48.000Z (over 1 year ago)
- Last Synced: 2025-06-09T23:39:01.293Z (8 months ago)
- Topics: cpp, filesystem, hacktoberfest, ocaml
- Language: OCaml
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ml-cpp-filesystem
OCaml embedded cross-platform C++ <[filesystem](https://en.cppreference.com/w/cpp/filesystem)>
the interface:
```OCaml
type path
module Path :
sig
val to_string : path -> string
val from_string : string -> path
val temp_directory : unit -> path
val exists : path -> bool
val file_size : path -> int
val append : path -> path -> path
val filename : path -> path
val extension : path -> path
val parent : path -> path
val root : path -> path
val absolute : path -> path option
val relative : path -> path option
val proximate : path -> path option
val canonical : path -> path option
val weakly_canonical : path -> path option
val path_type : path -> string
val is_regular_file : path -> bool
val is_directory : path -> bool
val is_fifo : path -> bool
val is_block_file : path -> bool
val is_character_file : path -> bool
val is_socket : path -> bool
val is_symlink : path -> bool
val is_other : path -> bool
end
module Permissions :
sig
type permissions
val get : path -> permissions option
val set : path -> permissions -> bool
val add : path -> permissions -> bool
val remove : path -> permissions -> bool
val to_string : permissions -> string
val to_dec : permissions -> int
val to_oct : permissions -> int
val from_oct : int -> permissions
end
val get_cwd : unit -> path
val set_cwd : path -> bool
val copy : path -> path -> bool
val copy_file : path -> path -> bool
val copy_symlink : path -> path -> bool
val create_directory : path -> bool
val create_directories : path -> bool
val create_hard_link : path -> path -> bool
val create_symlink : path -> path -> bool
val create_directory_symlink : path -> path -> bool
val equivalent : path -> path -> bool
val hard_link_count : path -> int
val read_symlink : path -> path option
val remove : path -> bool
val remove_all : path -> int
val rename : path -> path -> bool
val resize_file : path -> int -> bool
val space : path -> int list
type direntry
module Direntry :
sig
val as_path : direntry -> path
val direntry_exists : direntry -> bool
val is_regular_file : direntry -> bool
val is_block_file : direntry -> bool
val is_character_file : direntry -> bool
val is_directory : direntry -> bool
val is_fifo : direntry -> bool
val is_other : direntry -> bool
val is_socket : direntry -> bool
val is_symlink : direntry -> bool
val file_size : direntry -> int
val hard_link_count : direntry -> int
end
val list_directory : path -> 'a -> (direntry -> 'a -> 'a) -> 'a
```