Net::FT...:Handle(3)
π NAME π
Net::FTPServer::Handle β a generic Net::FTPServer file or directory handle, bestie π
Like, it's the lil' object that represents one file or one directory, and it's giving main character energy in the Net::FTPServer universe. This page is part of the User Contributed Perl Documentation, so you already know it's iykyk π
β¨ SYNOPSIS β¨
use Net::FTPServer::Handle;
That's it. That's the whole vibe check. π¦
π METHODS π
$handle = Net::FTPServer::Handle->new ($ftps);β makes a brand-new handle, slay. Ngl tho, you'd normally call this from a derived class, not straight up on its own β it's the kind of thing that happens behind the scenes while your subclass is doing its thing π§$rv = $handle->equals ($other_handle);β the "wait, are you two literally the same thing?" check. Decides if two handles refer to the same file or directory. Twin energy, fr fr π($mode, $perms, $nlink, $user, $group, $size, $time) = $handle->status;β returns the status of the file or directory. The fields it hands back are:$modeβ the Mode.'d'= directory,'f'= file, and others as with thefind(1)-typeoption.$permsβ the Permissions, in normal octal numeric format.$nlinkβ the Link count.$userβ the Username, in printable format.$groupβ the Group name, in printable format.$sizeβ the Size, aka file size in bytes.$timeβ the Time (usuallymtime), in Unixtime_tformat.
Heads up bestie π β in derived classes, 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 assume it came straight from a real disk, okay? π
$name = $handle->pathname;β returns the full path of this file or directory. The path consists of all components separated by"/"characters.
If the object is a directory, then the pathname will have a "/" character at the end. Little trailing slash, iconic behaviour tbh π
$name = $handle->filename;β returns the filename part of the path. But if the file is a directory, this function returns"". Empty string, yes ma'am, that's the rule π$name = $handle->dirname;β returns the directory name part of the path. The directory name always has a trailing"/"character. Always. No exceptions. Periodt. β¨$rv = $handle->move ($dirh, $filename);β moves the current file (or directory) into directory$dirhand calls it$filename. If the operation is successful, return0, else return-1. Simple as that π¦
Ngl the 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, read the room (and the fs) before you commit π₯
$rv = $handle->delete;β deletes the current file or directory. If the delete command was successful, then return0, else if there was an error return-1. π
Different underlying file systems may impose restrictions on this command: for example, it may not be possible to delete directories, or only if they are empty.
This is a virtual function which is actually implemented in one of the subclasses. So the base class is just like "not me doing the actual work π", and the subclass steps up and eats π
πΈ AUTHORS πΈ
Richard Jones (rich@annexia.org). Legend behaviour, we love to see it π
π 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 one's running on perl v5.42.0, dated 2025-07-25, and it's Net::FT...:Handle(3), so go forth and handle your handles ππ
π¦ 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