Expand description
Hangar’s file operations on an SSH connection (spec §6.3 of
SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md): the same
requests and results as a local folder, carried out by the host’s helper
(remote::files). Paths there are the host’s POSIX paths; ~ is its home.
The same rules as a WSL distro’s folders hold (wsl_fs): a host’s system
folders, its root and the home folder itself are never changed, only read.
There is no Trash on a remote host: deleting there is permanent, and the
UI says so before it does.
Structs§
- Remote
- Where a request runs: an SSH connection’s name and the pane asking (whose window shows any ssh prompt).
Constants§
- EDITOR_
MAX - The editor’s largest file, as for a local one.
- SYSTEM_
DIRS 🔒 - Folders on a host that are read, never changed (Linux and macOS).
Functions§
- create
fs.createon a host; the new path.- delete
fs.deleteon a host: PERMANENT, each path on its own. A link is removed, never followed (the helper’s rule).- editor_
may_ write - Whether the editor may write
pathon a host: as on this computer, only inside the user’s home there, and never in a system folder. - entry 🔒
- friendly 🔒
- home_of 🔒
- The host’s home as a tidy absolute path: the helper sends it as
$HOMEsays (a trailing/, or/when unset), and every comparison with it must see one spelling. - join 🔒
- list
fs.liston a host: the whole folder in one page (the helper pages it underneath), in its canonical form.- list_
error 🔒 - no_
trash - What
fs.trash(andfs.restore) say for a remote path: there is no Trash there. - open 🔒
- parent 🔒
- protected
- Whether changing
path(absolute,resolved) is refused: the root, a system folder or anything in one, or the home folder itself. Anything inside home is the user’s, even where home is under a system folder (/var/home/<user>on Fedora Silverblue, a home under/opt). - read_
file - The editor reading a file on a host: its bytes (at most
EDITOR_MAX), and whether nobody may write it. - refusal 🔒
- rename
fs.renameon a host; the new path.- resolve
pathon the host, absolute and tidy:~and a relative path underhome,.and empty parts dropped,..taken back a level (never above/), no trailing/.- ssh_
connection - The SSH connection a request names, if it names one: local and WSL requests (and none at all) go the usual way.
- valid_
name 🔒 - write_
file - The editor saving a file on a host, atomically there.