Net::FT...eHandle(3)
π Net::FTPServer::RO::FileHandle β the anonymous, read-only FTP server personality π
okay bestie, gather round, because this is Net::FTPServer::RO::FileHandle(3) β and yes it ships in the User Contributed Perl Documentation collection, which is exactly the vibe: handcrafted, community-coded, kind of iconic. π«Ά
This page is about the anonymous, read-only FTP server personality. That's the whole thing. It's the file-handle half of that personality, it does not want to let anyone write anything, and honestly? boundaries. we love to see it. β¨
πΈ SYNOPSIS πΈ
use Net::FTPServer::RO::FileHandle;
that's it. that's the whole synopsis. short and slay. π
π¦ METHODS π¦
$dirh = $fileh->dir;
hand you back the directory that this file is living in. it's giving "who's your parent". π
$fh = $fileh->open (["r"|"w"|"a"]);
open a file handle β and heads up, this one is derived from IO::Handle, so go peek at IO::Handle(3) if you want the full lore β in either read mode or write mode. you pass it one of "r", "w", or "a". that's the menu, no substitutions. π
($mode, $perms, $nlink, $user, $group, $size, $time) = $handle->status;
this is the β¨vibe checkβ¨ on a file or a directory. it hands you back seven fields, and here's the full breakdown because we do not gatekeep:
$modeβ Mode.'d'means directory,'f'means file, and there are others, same as what you'd get from thefind(1)-typeoption.$permsβ Permissions. normal octal numeric format, bestie, the classic.$nlinkβ Link count.$userβ Username, in printable format.$groupβ Group name, in printable format.$sizeβ Size. file size in bytes, no cap.$timeβ Time, usually mtime, in Unixtime_tformat.
lowkey important: 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 don't come for it when the numbers look made up. they might literally be made up. π
$rv = $handle->move ($dirh, $filename);
move the current file (or directory!) into the directory $dirh and rename it to $filename. successful? you get 0. it flopped? you get -1. simple as that. π₯
β οΈ and here's the tea: 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. π
$rv = $fileh->delete;
delete the current file. if the delete command was successful, return 0; else if there was an error, return -1. that's it. no take-backs, no undo button. π
$link = $fileh->readlink;
if the current file is really a symbolic link, read the contents of the link and return it. peek behind the curtain, get the real destination. iconic behavior. π
π AUTHORS π
Richard Jones (rich@annexia.org).
π COPYRIGHT π
Copyright (C) 2000 Biblio@Tech Ltd., Unit 2-3, 50 Carnwath Road, London, SW6 3EG, UK
β SEE ALSO β
and that's the page, bestie! π¦ written up for perl v5.42.0, dated 2025-07-25. go forth, be read-only, stay anonymous, and remember: no write access, no problems. periodt. π β¨πΈ
π¦ 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