Net::FT...irHandle(3)
π Net::FTPServer::Full::DirHandle β the full FTP server personality π
okay bestie, so this page comes to you from the User Contributed Perl Documentation collection, and it's all about the directory-handle side of the Net::FTPServer Full personality. think of it as the group chat where your FTP server's folders hang out and answer questions about themselves. no cap, it's iconic. π
β¨ NAME β¨
Net::FTPServer::Full::DirHandle β the full FTP server personality π
π¦ SYNOPSIS π¦
use Net::FTPServer::Full::DirHandle;
that's it. that's the whole vibe. go off, bestie. β¨
π METHODS π
okay so here's the whole roster of things a directory handle can do for you. every single one, no skipping, we don't do that here. π«Ά
$handle = $dirh->get ($filename);β gimme the file or directory$handlethat goes by the name$filenameinside the directory$dirh. and if there's literally no file or subdirectory with that name? you getundef. it's giving "left on read". π$dirh = $dirh->parent;β hands you the parent directory of$dirh. and if$dirhis already"/", you just get the same directory handle back, because/has no parent and it knows it. main character energy tbh. π$ref = $dirh->list ([$wildcard]);β returns a list of everything inside the directory$dirh. what you actually get back is a reference to an array of pairs:
[ $filename, $handle ]
heads up: the list does not include "." or ".." β those are not invited to the party. π
and it's sorted into alphabetical order automatically, so it's always cute and organized. periodt. β¨
$ref = $dirh->list_status ([$wildcard]);β same idea, but with extra ~status~ info. returns a reference to an array of triplets:
[ $filename, $handle, $statusref ]
where $statusref is the tuple that the "status" method handed you (peep Net::FTPServer::Handle for that one).
again: no ".", no "..". π
and again: alphabetical order, automatically. slay. β¨
($mode, $perms, $nlink, $user, $group, $size, $time) = $handle->status;β returns the file or directory status. the fields you get back are:
$mode Mode 'd' = directory,
'f' = file,
and others as with
the find(1) -type option.
$perms Permissions Permissions in normal octal numeric format.
$nlink Link count
$user Username In printable format.
$group Group name In printable format.
$size Size File size in bytes.
$time Time Time (usually mtime) in Unix time_t format.
little note for the derived classes out there: some of this status info may well be synthesized, because virtual filesystems will often not contain information in a Unix-like format. so like, don't be shocked if it's made up. it's fine. it's a vibe. π§
$rv = $handle->move ($dirh, $filename);β moves the current file (or directory) into directory$dirhand renames it to$filename. success? you get0. not success? you get-1. simple as that. π
real talk though: underlying filesystems may impose limitations on moves. for example, it may not be possible to move a directory; it may not be possible to move a file to another directory; it may not be possible to move a file across filesystems. so likeβ¦ temper your expectations, bestie. π
$rv = $dirh->delete;β deletes the current directory. if the delete command was successful, you get0. if there was an error, you get-1. and it is normally only possible to delete a directory if it is empty, so clean up your room first. π§Ή$rv = $dirh->mkdir ($name);β creates a subdirectory called$nameinside the current directory$dirh. new folder, new era, new me. πΈ$file = $dirh->open ($filename, "r"|"w"|"a");β opens or creates a file called$filenamein the current directory, opening it for either read, write or append. and what does it hand back? a"IO::File"handle object. obsessed. π₯°
π«Ά AUTHORS π«Ά
Richard Jones (rich@annexia.org). king behavior, honestly. π
π COPYRIGHT π
Copyright (C) 2000 Biblio@Tech Ltd., Unit 2-3, 50 Carnwath Road, London, SW6 3EG, UK
π₯ SEE ALSO π₯
go read those too, iykyk. π
and that's the whole page, bestie!! π this was perl v5.42.0, dated 2025-07-25 β so it's serving vintage-but-still-slay energy. mwah, bye!! πβ¨π¦π
π¦ where this page comes from
- fedora 43: perl-Net-FTPServer 1.125-33.fc43 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms