What are equivalent to some Sys functions in Eio and other Eio questions

Hi! I’m experimenting with Eio and had some questions about functions like Sys.is_directory, Sys.file_exists, Sys.is_regular_file, etc.

I couldn’t find equivalents in Eio, looking for example in Eio.Path, and in Eio.Fs.

When you’re in the Eio world, is the expectation that you should solely be able to implement all I/O and file system operations without resorting to Unix and Sys ? (Or can these functions be run within a specific Eio wrapper?).

To give you some background, I’m implementing some code that walks recursively a unix file system tree (like the tree utils). And I need to figure out when to recurse after calling Eio.Path.read_dir (and decide what to do when identifying a symlink, etc.).

Another question is about executing an external command. Perhaps like Sys.command, or Unix.create_process, or some way to execute another executable and talk to it via its standard channels. Is there an Eio friendly way this can be done?

Thanks for you help!

Yes, Eio is missing lots of them at the moment. I’ve added a list here: Add missing file operations · Issue #510 · ocaml-multicore/eio · GitHub

Ideally, yes, but you can use Eio_unix.run_in_systhread to run Unix operations without blocking your Eio thread if you need to.

It just got added last week (#499): Running processes.

Great, that clarifies it for me. Thanks @talex5 ! :smiley: