vfslib(3tcl)

πŸ“¦
version 1.4.2~20230906 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ vfslib β€” Tcl-only Virtual File Systems, but make it a group chat ✨

okay so bestie, welcome to vfslib(3tcl) πŸ’– this is the manual for ::vfslib, and it's genuinely one of the most underrated little corners of Tcl. let's get into it 🫢


πŸŽ€ NAME πŸŽ€

::vfslib β€” procedures to interact with virtual filesystems. that's it, that's the whole vibe. virtual filesystems. imaginary drives. fake-but-real directories. iconic behavior honestly πŸ‘‘


🌸 SYNOPSIS 🌸

first things first, you gotta have Tcl, and you gotta pull in the packages. all of them. here's the full lineup, no skips:

package require Tcl

package require vfs ?1.2.1?

package require vfs::zip ?1.0?

package require vfs::mk4 ?1.6?

package require vfs::tar ?0.9?

package require vfs::ftp ?1.0?

package require vfs::ns ?1.0?

package require vfs::webdav ?0.1?

package require vfs::http ?0.5?

package require vfs::urltype ?1.0?

and then the actual mounting commands, which is where the magic happens ✨

vfs::zip::Mount path to

vfs::ftp::Mount path to

vfs::tar::Mount path to

vfs::http::Mount path to

vfs::mk4::Mount path to

vfs::ns::Mount path to

vfs::urltype::Mount type
notice how every single one of those is Mount with a capital M and then path to (or type for urltype). keep them exactly like that, bestie, don't go freestyling the casing πŸ’…

πŸ’… DESCRIPTION πŸ’…

so the ::vfs package ships with a whole library of Tcl code β€” that's the ::vfslib part β€” and that library implements a bunch of different virtual filesystems. each one is its own separate package, which is why you access them with package require vfs::NAME. the entire collection of these virtual filesystems has an informal nickname: 'vfslib'. cute, right? πŸŽ€


πŸ¦‹ SUPPORTED VFS TYPES πŸ¦‹

the types currently supported are, in order:

  • ftp
  • tar
  • http
  • zip
  • mk4
  • ns
  • webdav

that's the roster. πŸ’–

on top of that, there's a whole extra ability: you can mount any 'urltype' as a new volume, provided an appropriate vfs is supported. which means β€” and this is the fun part β€” you can treat 'ftp://', 'http://' and 'file://' urls as actual files. like, files you can just… open. obsessed. 😭✨

to do that, you simply evaluate the command. for instance:

vfs::urltype::Mount ftp

and here's the tea β˜• any access inside that new volume will trigger an attempt to require a package through 'package require vfs::${type}'. so that package has to actually exist β€” otherwise, errors will be thrown. no package, no volume, periodt. πŸ’€


πŸ™ˆ LIMITATIONS πŸ™ˆ

ngl, most of the vfs types listed above have not been very well debugged as yet.

please test them!

fr fr, that's a direct request from the manpage itself. go be the main character and test them 🫢

⭐ KEYWORDS ⭐

vfs, vfslib, filesystem, zip, tar, webdav, namespace, ftp, http, file


and that's the whole page, bestie 🌈 this was Vfslib, version 1.0, and it lives in the vfslib(3tcl) corner of your manual. now go mount something weird and tell me how it goes πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from