Net::FT...irHandle(3)
β¨ NAME β¨
Net::FTPServer::DirHandle β it's a directory handle for Net::FTPServer, bestie. That's the whole vibe. It's the little object that represents a directory in your FTP server, and it's lowkey carrying the whole file-management situation π
This page lives in the User Contributed Perl Documentation section, and the manual name is Net::FTPServer::DirHandle(3) β iykyk π
πΈ SYNOPSIS πΈ
use Net::FTPServer::DirHandle;
That's it. That's the whole intro. Short, sweet, iconic π
π METHODS π
Okay so here's where the real content lives. Every method, no skips, periodt:
$dirh = new Net::FTPServer::DirHandle ($ftps);β bestie, this makes you a brand new directory handle. And guess which directory it corresponds to? Just"/". The root. Main character energy from the jump π$dirh = $dirh->parent;β hands you back the parent directory of$dirh. But if$dirhis already"/"? It just returns the same directory handle. No drama, no crash, just vibes π¦$rv = $dirh->is_root;β returns true if the current directory is the root directory. Simple as that, no cap β¨$handle = $dirh->get ($filename);β give it a$filenameand it gives you back the file-or-directory$handlefor that name inside directory$dirh. And if there's literally no file or subdirectory with that name? It returnsundef. We love an honest function π$ref = $dirh->list ([$wildcard]);β returns a list of everything inside directory$dirh. What you get back is a reference to an array of pairs:
[ $filename, $handle ]
Important deets, bestie:
- The list does not include
"."or".."π - The list is sorted into alphabetical order automatically. She organizes herself π
$ref = $dirh->_list_status ([$wildcard]);β and I oop, the docs literally call this one "just a dumb wrapper function." π It returns the same thing aslist_status(), except it also includes the special directories"."and".."when no wildcard is specified. That's the only difference, fr fr.$ref = $dirh->list_status ([$wildcard]);β returns the contents of directory$dirhplus status information. What you get back is a reference to an array of triplets:
[ $filename, $handle, $statusref ]
where $statusref is the tuple returned from the "status" method (go peek at Net::FTPServer::Handle for that one π«Ά).
Same rules as before:
- No
"."and no".."in the list π - Sorted into alphabetical order automatically β¨
$rv = $dirh->delete;β deletes the current directory. Success? You get0. Error? You get-1. Binary queen π
Heads up bestie: it's normally only possible to delete a directory if it is empty. Don't come for me when it refuses, that's just how she is πΈ
$rv = $dirh->mkdir ($name);β creates a subdirectory called$nameinside the current directory$dirh. New folder, who dis π$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? An"IO::File"handle object. Iconic. Slay. Periodt π₯
π AUTHORS π
Richard Jones (rich@annexia.org). Give him his flowers π
π COPYRIGHT π
Copyright (C) 2000 Biblio@Tech Ltd., Unit 2-3, 50 Carnwath Road, London, SW6 3EG, UK
π SEE ALSO π
And that's the whole page, bestie β this was perl v5.42.0 documentation, dated 2025-07-25, for Net::FTPServer::DirHandle(3). Go forth and manage those directories πβ¨π¦
π¦ 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