Plan 9: Compressed Archives
Plumb Zip file
View files inside a zip compressed file via Plumber without extraction. Zip file contents are accessible at /n/tapefs. (Note: sam displays the UTF Byte-Order-Mark (BOM) as is - the garbage in the beginning of the first line).
#zip file content in a new window
type is text
data matches '([a-zA-Z¡-￿0-9_\-.,/]+)\.zip'
arg isfile $0
plumb start window fs/zipfs $file; cd /n/tapefs; ls; rc
type is text
data matches '([a-zA-Z¡-￿0-9_\-.,/]+)\.zip'
arg isfile $0
plumb start window fs/zipfs $file; cd /n/tapefs; ls; rc
Plumber process, usually running in the parent process, does not have visibility into the folders mounted by the child process because of namespace isolation. Hence, you need the following changes:
- zipfs (or 32vfs, cpiofs, tapfs, tarfs, tpfs, v6fs, v10fs etc.) must expose a service in the /srv directory. (fs.c)
- plumber must mount the zipfs for paths starting with /n/tapefs before checking for file existence. (match.c)
Archive Edit
Use shell commands to edit archive files. This is a wrapper rc script using ramfs and tar.
Comments
Post a Comment