2

My clients have many programs that read and write files of a certain format. They do it by sending regular old system calls, so libraries like gio aren't (in the general case) involved. I would like store the data in a database instead of the files, although I can't change the programs that read and write the files. Instead, I need to store the data in a database while tricking the programs into thinking they are reading and writing files.

One potential solution would be to have some kind of pseudo-file, where all of the read, write and seek requests get re-directed to a program I could write, which could then synthesize the correct response via communication with the database. This task sounds vaguely like NFS, so maybe it's possible. What should I read about to get this working?

  • 1
    That depends from what operating system you are using. Is it based upon the Hurd? Solaris? Linux? FreeBSD? – JdeBP Apr 18 at 18:06
  • 1
    Even if they don't use GIO, if the gvfs fuse Daemon is running, you'll still be able to access gvfs mounts using regular system calls (e.g. you can run plain old cp on gvfs files). – muru Apr 18 at 18:10
3

What you are describing is fuse. User mode file-systems. They look like file-systems but have custom internals.

Some existing ones are:

  • sshfs file-system over ssh.
  • tar / zip fs mount a tar / zip file.
  • cloud fs
  • ipfs
  • ntfs
  • encrypted fs
  • webdav
  • ftp
  • amazon S3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.