ProzillaOS/docs/features/virtual-drive/README.md
2023-08-15 18:55:43 +02:00

783 B

← Back

Virtual Drive

Related document: Storage

The virtual drive is a virtual file and directory system. The root directory is a virtual folder and the access point for all interactions with the virtual drive.

Table of Contents

Examples

Component interacting with virtual drive

// components/applications/example/Example.jsx

export function Example() {
	const virtualRoot = useVirtualRoot();
	const [currentDirectory, setCurrentDirectory] = useState(virtualRoot.navigate("~"));

	currentDirectory.createFile("example", "txt", (file) => {
		file.setContent("Foo bar.");
	});
}