LUA-URI-FTP(3)
π LUA-URI-FTP(3) π
okay bestie, welcome to the Lua uri.ftp module manual, aka the glow-up guide for FTP URIs in the Lua URI library. yes, the manpage is literally called LUA-URI-FTP(3) and yes we're gonna make it cute. let's go π¦
β¨ NAME β¨
lua-uri-ftp β FTP URI support for the Lua URI library. that's it, that's the vibe π
πΈ DESCRIPTION πΈ
so the class uri.ftp is what you use for URIs with the ftp scheme. it inherits from the uri._login class, so it's basically picking up everything that class already knows how to do. family tree moment π
now here's the important tea:
- FTP URIs with a missing authority part or an empty host part are considered invalid. like, we're not doing that. no host, no service π«
- An empty path is always normalized to
'/'. always. it's a whole thing. - The default port is
21. remember it, it's iconic.
π METHODS π
everything defined in lua-uri(3) and lua-uri-_login(3) is supported, plus the bonus method below. so you already have a lot, and then this one shows up to slay π
uri:ftp_typecode(...)β this is the mutator for the'type'parameter that lives at the end of the path. if you supply the optional argument, a new type is set, replacing whatever was there before β or, if there wasn't a type parameter yet, it gets added to the path. lowkey magical β¨
here's the moment in code:
local uri = assert(URI:new("ftp://host/path"))
uri:ftp_typecode("a") -- ftp://host/path;type=a
uri:ftp_typecode(nil) -- ftp://host/path
and a couple of details you don't wanna miss:
- Passing in an empty string has the same effect as
nil: it removes the parameter. same energy, fr fr. - An empty type parameter will be returned as
nilβ the exact same as if the parameter was just missing entirely. so don't be surprised, bestie π
π REFERENCES π
this class is based on "RFC 1738 section 3.2". and unfortunately, there isn't currently an RFC for FTP URIs based on the more up to date "RFC 3986". so yeah. we work with what we've got. it's giving vintage but make it work π
and that's the whole page, babe π«Ά this was version 1.1, dated 2012-00-00, and it's the Lua uri.ftp module page β LUA-URI-FTP(3) forever. mwah πβ
π¦ where this page comes from
- debian trixie: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu noble: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu questing: lua-uri 0.1+20130926+git14fa255d-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms