Documentation Index
Fetch the complete documentation index at: https://mintlify.com/shadownrx/windows/llms.txt
Use this file to discover all available pages before exploring further.
useFileSystem provides access to the Virtual File System (VFS) context — an in-memory file system that supports full CRUD operations without ever touching the user’s real disk. Because NEX OS runs entirely in the browser, all files and folders exist only in React state, giving your applications a safe, sandboxed environment to create, read, update, and delete content just as they would on a real operating system.
Import
VirtualFile Interface
Every file in the VFS is represented as aVirtualFile object.
Auto-generated unique identifier returned by
createFile. Use this to reference the file in updateFileContent calls.The file’s display name, without the extension.
The virtual directory path where the file lives, e.g.
'/Users/Default/Documents'.The file extension without a leading dot, e.g.
'txt', 'js', 'nex'.The raw text content of the file. Binary files are represented as base64-encoded strings.
Timestamp set when the file was created via
createFile.Properties
The complete flat list of all virtual files currently in the VFS. Filter by
location to display directory-scoped listings, or search by extension to find files of a specific type.Methods
createFile
Creates a newVirtualFile in the specified directory and returns the auto-generated id of the newly created file.
The virtual directory path where the file should be created, e.g.
'/Users/Default/Documents'.Display name for the new file, without the extension.
File extension without a leading dot, e.g.
'txt' or 'md'.string — the id of the newly created file.
updateFileContent
Replaces thecontent field of an existing file with new text.
The unique identifier of the file to update. Obtain this from
createFile or from files.find(...).The new content string to write into the file. Overwrites any previous value.
navigate
Updates the activecurrentPath in the File Explorer, causing it to render the contents of the target directory.
The virtual path to navigate to, e.g.
'/Users/Default/Pictures'.openFile
Opens aVirtualFile in the appropriate system application. The VFS inspects the file’s extension to determine which app to launch via the WindowManager.
The file object to open. Pass a reference from the
files array directly.createFolder
Creates a new virtual directory inside the current path.Display name of the new folder.
deleteFile
Removes a file or folder from the VFS by its path.The full virtual path of the file or folder to delete, e.g.
'/Users/Default/Documents/notes.txt'.getFileContent
Reads and returns the content of a file at the given path without opening it in a window.Full virtual path of the file to read.
string | Buffer — the file’s raw content, or a Buffer for binary files.
Usage Example
The following example shows howNotepad uses useFileSystem to load an existing file’s content and autosave changes on blur.
Virtual Directory Tree
The VFS is pre-seeded with a familiar directory structure on startup:The VFS is entirely sandboxed in browser memory — there is no access to the user’s real filesystem. This is a deliberate security boundary enforced by the browser. All file data is lost on a hard page refresh unless you build persistence on top of
localStorage or IndexedDB.