mirror of
https://github.com/ocaml-multicore/eio.git
synced 2025-07-17 00:01:11 -04:00
Compare commits
2 Commits
9b86081a31
...
2b8cdede5e
Author | SHA1 | Date | |
---|---|---|---|
|
2b8cdede5e | ||
|
988e85a0b5 |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# To work around MDX issues
|
||||||
|
README.md text eol=lf
|
14
README.md
14
README.md
@ -752,12 +752,17 @@ Eio.Io Net Connection_failure Refused Unix_error (Connection refused, "connect",
|
|||||||
```
|
```
|
||||||
|
|
||||||
If we ran this using another backend, the `Unix_error` part might change.
|
If we ran this using another backend, the `Unix_error` part might change.
|
||||||
To avoid this problem, you can use `Eio.Exn.Backend.show` to hide the backend-specific part of errors:
|
To avoid this problem, you can use `Eio.Exn.Backend.show`
|
||||||
|
|
||||||
```ocaml
|
```ocaml
|
||||||
# Eio.Exn.Backend.show := false;;
|
# Eio.Exn.Backend.show := false;;
|
||||||
- : unit = ()
|
- : unit = ()
|
||||||
|
```
|
||||||
|
|
||||||
|
to hide the backend-specific part of errors:
|
||||||
|
|
||||||
|
<!-- $MDX os_type<>Win32 -->
|
||||||
|
```ocaml
|
||||||
# Eio_main.run @@ fun env ->
|
# Eio_main.run @@ fun env ->
|
||||||
let net = Eio.Stdenv.net env in
|
let net = Eio.Stdenv.net env in
|
||||||
Switch.run @@ fun sw ->
|
Switch.run @@ fun sw ->
|
||||||
@ -842,7 +847,8 @@ let try_mkdir path =
|
|||||||
The checks also apply to following symlinks:
|
The checks also apply to following symlinks:
|
||||||
|
|
||||||
```ocaml
|
```ocaml
|
||||||
# Unix.symlink "dir1" "link-to-dir1"; Unix.symlink "/tmp" "link-to-tmp";;
|
# Unix.symlink "dir1" "link-to-dir1";
|
||||||
|
Unix.symlink (Filename.get_temp_dir_name ()) "link-to-tmp";;
|
||||||
- : unit = ()
|
- : unit = ()
|
||||||
|
|
||||||
# Eio_main.run @@ fun env ->
|
# Eio_main.run @@ fun env ->
|
||||||
@ -881,6 +887,7 @@ perhaps with `open_dir` to constrain all access to be within that directory.
|
|||||||
|
|
||||||
Spawning a child process can be done using the [Eio.Process][] module:
|
Spawning a child process can be done using the [Eio.Process][] module:
|
||||||
|
|
||||||
|
<!-- $MDX os_type<>Win32 -->
|
||||||
```ocaml
|
```ocaml
|
||||||
# Eio_main.run @@ fun env ->
|
# Eio_main.run @@ fun env ->
|
||||||
let proc_mgr = Eio.Stdenv.process_mgr env in
|
let proc_mgr = Eio.Stdenv.process_mgr env in
|
||||||
@ -892,6 +899,7 @@ hello
|
|||||||
There are various optional arguments for setting the process's current directory or connecting up the standard streams.
|
There are various optional arguments for setting the process's current directory or connecting up the standard streams.
|
||||||
For example, we can use `tr` to convert some text to upper-case:
|
For example, we can use `tr` to convert some text to upper-case:
|
||||||
|
|
||||||
|
<!-- $MDX os_type<>Win32 -->
|
||||||
```ocaml
|
```ocaml
|
||||||
# Eio_main.run @@ fun env ->
|
# Eio_main.run @@ fun env ->
|
||||||
let proc_mgr = Eio.Stdenv.process_mgr env in
|
let proc_mgr = Eio.Stdenv.process_mgr env in
|
||||||
@ -904,6 +912,7 @@ ONE TWO THREE
|
|||||||
If you want to capture the output of a process, you can provide a suitable `Eio.Flow.sink` as the `stdout` argument,
|
If you want to capture the output of a process, you can provide a suitable `Eio.Flow.sink` as the `stdout` argument,
|
||||||
or use the `parse_out` convenience wrapper:
|
or use the `parse_out` convenience wrapper:
|
||||||
|
|
||||||
|
<!-- $MDX os_type<>Win32 -->
|
||||||
```ocaml
|
```ocaml
|
||||||
# Eio_main.run @@ fun env ->
|
# Eio_main.run @@ fun env ->
|
||||||
let proc_mgr = Eio.Stdenv.process_mgr env in
|
let proc_mgr = Eio.Stdenv.process_mgr env in
|
||||||
@ -913,6 +922,7 @@ or use the `parse_out` convenience wrapper:
|
|||||||
|
|
||||||
All process functions either return the exit status or check that it was zero (success):
|
All process functions either return the exit status or check that it was zero (success):
|
||||||
|
|
||||||
|
<!-- $MDX os_type<>Win32 -->
|
||||||
```ocaml
|
```ocaml
|
||||||
# Eio_main.run @@ fun env ->
|
# Eio_main.run @@ fun env ->
|
||||||
let proc_mgr = Eio.Stdenv.process_mgr env in
|
let proc_mgr = Eio.Stdenv.process_mgr env in
|
||||||
|
1
dune
1
dune
@ -2,5 +2,4 @@
|
|||||||
(package eio_main)
|
(package eio_main)
|
||||||
(deps (package eio_main) (env_var "EIO_BACKEND"))
|
(deps (package eio_main) (env_var "EIO_BACKEND"))
|
||||||
(preludes doc/prelude.ml)
|
(preludes doc/prelude.ml)
|
||||||
(enabled_if (<> %{os_type} "Win32"))
|
|
||||||
(files README.md))
|
(files README.md))
|
||||||
|
3
eio.opam
3
eio.opam
@ -47,3 +47,6 @@ build: [
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
dev-repo: "git+https://github.com/ocaml-multicore/eio.git"
|
dev-repo: "git+https://github.com/ocaml-multicore/eio.git"
|
||||||
|
pin-depends: [
|
||||||
|
[ "mdx.dev" "git+https://github.com/polytypic/mdx.git#7101533dedf90983e760d8a08f8bfeef4fedb89b" ]
|
||||||
|
]
|
||||||
|
3
eio.opam.template
Normal file
3
eio.opam.template
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pin-depends: [
|
||||||
|
[ "mdx.dev" "git+https://github.com/polytypic/mdx.git#7101533dedf90983e760d8a08f8bfeef4fedb89b" ]
|
||||||
|
]
|
@ -1,12 +1,13 @@
|
|||||||
(library
|
(library
|
||||||
(name eio_windows)
|
(name eio_windows)
|
||||||
(public_name eio_windows)
|
(public_name eio_windows)
|
||||||
(library_flags :standard -ccopt -lbcrypt -ccopt -lntdll)
|
(library_flags :standard -cclib -lbcrypt -cclib -lntdll)
|
||||||
(enabled_if (= %{os_type} "Win32"))
|
(enabled_if (= %{os_type} "Win32"))
|
||||||
(foreign_stubs
|
(foreign_stubs
|
||||||
(language c)
|
(language c)
|
||||||
(include_dirs ../lib_eio/unix/include)
|
(include_dirs ../lib_eio/unix/include)
|
||||||
(names eio_windows_stubs eio_windows_cstruct_stubs))
|
(names eio_windows_stubs eio_windows_cstruct_stubs))
|
||||||
|
(c_library_flags :standard -lbcrypt -lntdll)
|
||||||
(libraries eio eio.unix eio.utils fmt))
|
(libraries eio eio.unix eio.utils fmt))
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
|
Loading…
x
Reference in New Issue
Block a user