The file server is also responsible for managing the CWD (e.g. via :file.set_cwd/1).
Is there a way to utilize multiple file servers so you could do things like have a different CWD for different processes? I’d like to avoid/minimize the CWD as a source of global mutable state if possible.
I’d guess you can roll your own Supervisor + GenServers with a router/dispatcher, and each GenServer uses raw file access and just copies its results back in its handle_call functions?
The best way to avoid cwd as global state is to not rely on cwd by using absolute paths / relative paths at a single cwd, which is supposed to never change.