Files
Every Retro PC account has its own files: My Documents, My Pictures, My Music, the Desktop folder and anything made inside them. They live on the server, so they follow the person to any device they log on to. A machine has one storage quota shared by its accounts.
One interface, two stores
Section titled “One interface, two stores”Apps never talk to storage directly. They use the FileSystem interface on the user session
(session.files):
| Implementation | Used in | Keeps files |
|---|---|---|
ServerFileSystem |
Normal use | On the server, through retro-core’s /api/fs/* |
MemoryFileSystem |
Demo mode, tests | In the browser, gone on reload |
Both pass the same contract tests (FileSystem.contract.ts), so an app that works in demo
mode works for real.
Built on top
Section titled “Built on top”FolderBrowser: one folder view’s location, Back, Forward, Up, view, sort and selection.FileOperations: copy, move and delete, with Windows XP’s messages.FileClipboard: Cut and Copy for the session, so Paste works in any window.- The Open and Save As dialogs, My Documents and the desktop all build on these.
On the server
Section titled “On the server”retro-core is the only writer of the files table and the file objects in storage. Every
write takes the machine’s row lock, so the quota and folder moves are checked together. After a
change it sends fsChanged to the account’s open connections, and every open window updates.