Net::FT...irHandle(3)

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

πŸ’– 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 $handle that goes by the name $filename inside the directory $dirh. and if there's literally no file or subdirectory with that name? you get undef. it's giving "left on read". πŸ’€
  • $dirh = $dirh->parent; β€” hands you the parent directory of $dirh. and if $dirh is 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 $dirh and renames it to $filename. success? you get 0. 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 get 0. 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 $name inside the current directory $dirh. new folder, new era, new me. 🌸
  • $file = $dirh->open ($filename, "r"|"w"|"a"); β€” opens or creates a file called $filename in 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 (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