Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Support ramfs through type RamDir #42

Closed
vitiral opened this issue Jan 26, 2018 · 2 comments
Closed

Support ramfs through type RamDir #42

vitiral opened this issue Jan 26, 2018 · 2 comments

Comments

@vitiral
Copy link

vitiral commented Jan 26, 2018

I'm curious whether tempdir would be interested in adding a RamDir type if it were possible to make such a type.

tmpfs is:

tmpfs is a temporary filesystem that resides in memory and/or swap partition(s). Mounting directories as tmpfs can be an effective way of speeding up accesses to their files, or to ensure that their contents are automatically cleared upon reboot.

It looks like there is a (linux only) libmount that could be leveraged to do the job, although I would prefer using ramfs, as it is guaranteed to be in ram. I haven't looked at that crate, but ramfs could potentially be added there.

It's also at least theoretically possible to support windows, as a tool exists called ImDisk, but this issue is suggesting unix-only support through the tmpfs call (for now).

This issue is mostly to ask whether this feature would be supported by the project devs or whether a new crate should be made instead. Thanks!

@KodrAus
Copy link
Contributor

KodrAus commented Jan 28, 2018

Hi @vitiral! This is an interesting idea. I think a separate crate is probably the best place to start because of the potential difficulty in cross-platform support, and because I think an in-memory fs is a useful thing in its own right with some separate use-cases to just probably-temporary directories on disk.

@vitiral
Copy link
Author

vitiral commented Feb 6, 2018

that sounds good

@vitiral vitiral closed this as completed Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants