Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Read-only and Copy-on-write v2 #155

james-pre started this conversation in Ideas
Discussion options

Note

These are rough ideas.
They are not guaranteed features and could change significantly in any actual implementation.
Community feedback is appreciated

There are various use-cases and scenarios where more customization and configuration would be helpful. Additionally, implementing these configurations within the "emulation" or virtualization layer would come with some performance and extensibility benefits.

1. read-only

At the moment, read-only file systems must use a mixin. Additionally, there is no way to use a read-write file system as read-only. It would be nice to be able to configure a file system to be read-only independent of whether the file system is actually read-only:

await configure({
	mounts: {
		'/': {
			backend: InMemory,
			readonly: true,
		}
	}
});
fs.writeFileSync('/example.txt'); // EROFS

This would allow for some more complex configurations, and allow (for example) a consuming Unix simulator to support /etc/fstab's ro option.

2. copy-on-write

Going further, file systems that only support read-only operations, like Fetch, can often times be difficult to use:

await configure({
	mounts: {
		'/': {
			backend: Overlay,
			readable: Fetch, 
			writable: InMemory,
		}
	}
});

In addition to proper typing, this would also make it more clear what is actually happening:

await configure({
	mounts: {
		'/': {
			backend: Fetch,
			copy_on_write: true,
			write_to: InMemory,
		}
	}
});
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /