Net::FT...eHandle(3)

πŸ“¦
version 1.125 Β· 2 versions
, in fedora 43

πŸ’– 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. πŸ“

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 the find(1) -type option.
  • $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 Unix time_t format.
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. πŸ’€

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 (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