Files and directories
The files disk
Section titled “The files disk”A program sees one disk as /. That disk is chosen the first time anything
touches a file:
- the disk the computer booted from, if it’s writable;
- otherwise the first writable disk. So with the read-only shell floppy booted, files go to your hard drive;
- otherwise a read-only disk.
The computer’s tmpfs is never used. The shell’s cd and ls work on the
same disk, and info shows which one it is (files:). A program and every
program it runs share the same files disk.
Programs are looked up differently: /bin is searched on the boot disk and
then on every other disk. That’s why the floppy’s programs run even though
files go to the hard drive.
The current directory
Section titled “The current directory”cd changes the shell’s current directory, which the prompt shows. Programs
start in it, and relative paths start there:
The directory is passed to programs as the PWD environment variable, and
programs built with the
wackasm-opencomputers crate change into
it before main. A WASI program that doesn’t use the crate starts in /;
see Files in your programs.
Copying files onto a disk
Section titled “Copying files onto a disk”- With an internet card, download them:
curl -o notes.txt https://example.com/notes.txt. See Internet. - On the server, every OpenComputers disk is a folder:
<world>/opencomputers/<disk address>/. Find the address withcomponentsorinfo. - From a Lua computer with OpenOS: put the disk in it and use OpenOS’s
tools (
wget,cp), then move the disk back.