Net::FT...irHandle(3)

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

✨ 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 $dirh is 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 $filename and it gives you back the file-or-directory $handle for that name inside directory $dirh. And if there's literally no file or subdirectory with that name? It returns undef. 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 as list_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 $dirh plus 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 get 0. 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 $name inside the current directory $dirh. New folder, who dis πŸŽ€
  • $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? An "IO::File" handle object. Iconic. Slay. Periodt πŸ”₯

πŸ’œ AUTHORS πŸ’œ

Richard Jones (rich@annexia.org). Give him his flowers πŸ’


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