[erlang-questions] simple virtual file system in Erlang?
Sun Mar 26 22:56:30 CEST 2017
There is an undocumented module in the kernel application called ram_file which could allow you to use file functions while operating on data that is only in-memory. Despite how advantageous this can be, to switch from in-memory file operations to filesystem operations, you shouldn't use that approach until it becomes documented, since it could be removed at any time. So far, it appears the ram_file module will be removed based on the closed bug at https://bugs.erlang.org/browse/ERL-36
On 03/26/2017 05:45 AM, Marco Molteni wrote:
> Hello colleagues,
> I would like to start from the presentation "Build an FTP Server with Ranch in 30 Minutes" and really build an FTP server, so at a certain point I need to hit the filesystem.
> Since the idea is still as a presentation (as opposed to building a production FTP server) I don't want to touch the real filesystem of the host, I want to use a as simple as possible virtual filesystem. It could be backed by DETS or Mnesia for example, or it could stay only in memory.
> On the other hand, it must still behave as a filesystem, that is, it must be hierarchical, so a direct mapping to a key/value store would not be enough. In the spirit of simplicity, I don't need any concept of read/write permission, I simply need a sort of graph with two types: inner nodes are directories, leaf nodes are files or empty directories.
> I am thinking to use DETS and somehow introduce a very simple intermediate layer that would offer the impression to be in a graph (each non-leaf node a directory) and map it to the DETS key/value API.
> Any suggestions?
>  https://ninenines.eu/articles/ranch-ftp/
> erlang-questions mailing list
More information about the erlang-questions