I’m having a hard time understanding the file server concept in Erlang. From the docs I came up with some assumptions, but I’m not sure they actually hold.
So I assume that this only makes a difference if you’re running multiple nodes, right? Does the file server work on all nodes simultaneously? I.e. if I call the Elixir function File.exists?/2 and I don’t pass the :raw option, is it going to return true if the file exists on the file system of any one node? Also if I call File.open/2, does it open the file on any node if it exists, even if it does not exist on the node where the call is made?
There’s no difference. :file is for handling concurrent file access within a single beam instance (besides :raw). So multiple processes on the same instance trying to work with files. It’s doing nothing for distributed nodes afaik.
You have the same problem you have with multiple nodes with multiple processes. Without :raw all file operations go through the file server, which can coordinate concurrent access by multiple processes. With :raw only a single process can access the file at a time, as otherwise concurrent access (especially for writes) can corrupt the file.
Oh I think I know now. It’s just that with :raw you can’t use a remote file server but it’s faster. If you wan’t to open files remotely as described in this post, you can’t pass :raw.