memfd: Open temporary anonymous Linux file handles

[ apache, filesystem, library, linux ] [ Propose Tags ]

"memfd" (memory file descriptor) lets us open pseudo-"files" that are not actually stored in the "real" file system. This feature is only available on Linux.

Such a file is described as an "anonymous file". It behaves like a regular file, and so can be modified, truncated, memory-mapped, and so on. However, unlike a regular file, it lives in RAM and has a volatile backing storage. Once all references to the file are dropped, it is automatically released.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.0, 1.0.1.0, 1.0.1.1
Change log changelog.md
Dependencies base (>=4.14 && <4.18), transformers (>=0.5.6 && <0.7) [details]
License Apache-2.0
Copyright 2022 Mission Valley Software LLC
Author Chris Martin
Maintainer Chris Martin, Julie Moronuki
Category Filesystem, Linux
Home page https://github.com/typeclasses/memfd
Bug tracker https://github.com/typeclasses/memfd/issues
Source repo head: git clone git://github.com/typeclasses/memfd.git
Uploaded by chris_martin at 2023-01-02T04:53:41Z
Distributions LTSHaskell:1.0.1.1, NixOS:1.0.1.1, Stackage:1.0.1.1
Downloads 100 total (28 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for memfd-1.0.1.1

[back to package description]

"memfd" (memory file descriptor) lets us open pseudo-"files" that are not actually stored in the "real" file system. This feature is only available on Linux.

Such a file is described as an "anonymous file". It behaves like a regular file, and so can be modified, truncated, memory-mapped, and so on. However, unlike a regular file, it lives in RAM and has a volatile backing storage. Once all references to the file are dropped, it is automatically released.

The recommended way to import this library is:

import qualified Memfd

There is one central function:

create :: CreateOptions -> IO Fd

Fd stands for "file descriptor". Here are some things you can do with a file descriptor: