bos
bos copied to clipboard
Basic OS interaction for OCaml
I have been looking for an OCaml library with a robust implementation that provides a uniform, cross-platform interface for XDG Directories / Known Folders (Windows) / Standard Directories (macOS), and...
The environment variable `HOME` is not standard on Windows and should probably fallback to `USERPROFILE`.
They're nicer and also tail-recursive. https://ocaml.org/manual/coreexamples.html#s%3Aexceptions https://ocaml.org/manual/patterns.html#sss:exception-match
That binds to [`realpath(3)`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html) on POSIX. On Windows @bobatkey suggests using [`GetFullPathName`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.aspx).
same as Pat.of_string etc. This makes programming and composition easier (avoids calls to Rresult.R.open_error_msg).
The documentation says > Atomic writes.} Files are written atomically by the functions. They create a temporary file [t] in the directory of the file [f] to write, write the...
OS.File.write functions use with_oc, which creates temporary files in the directory of the target file. This however fails if the user has just permissions to write to the file, but...
Under Windows, using the following programs the `\n` in `data` is converted to `\r\n` when the two programs are compiled and run as `main.exe test.exe`: ![screen shot 2016-10-28 at 3...
I was curious if `bos` would be a suitable place to normalize the behavior of `Unix.select` across various operating systems, (and for versions of OCaml (`< 4.08` likely) which will...