Net::FT...:Handle(3)

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

πŸ’– 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 the find(1) -type option.
    • $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 (usually mtime), in Unix time_t format.
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 $dirh and calls it $filename. If the operation is successful, return 0, 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 return 0, 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 (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