Net::SF...nstants(3)
π NAME π
Net::SFTP::Constants β bestie, it's the exportable SFTP constants situation. That's the whole vibe. β¨
π¦ SYNOPSIS π¦
use Net::SFTP::Constants qw( :tag CONSTANT );
print "Constant value is ", CONSTANT;
okay so that's literally the entire flex. you pull in a tag or a constant, and then you print it like it's nothing. slay. π
πΈ DESCRIPTION πΈ
Net::SFTP::Constants hands you a whole lil roster of exportable SFTP constants: stuff for SFTP messages and commands, for file-open flags, for status messages, etc. etc. the whole friend group. π«Ά
And the way you get them? Two ways, bestie: you can export constants individually, or you can grab them in sets that are identified by tag names. choose your fighter. π
Now here's the tea β β Net::SFTP::Constants provides values for all of the constants listed in the SFTP protocol version 3 draft. literally all of them. the only thing to note (and it's a tiny thing, don't panic) is that the constants are listed with the prefix SSH2 instead of SSH. so like, not a big deal, just a lil glow-up on the prefix. π
So for example, to import the constant for the file-open command, you would write:
use Net::SFTP::Constants qw( SSH2_FXP_OPEN );
see? easy. iconic behavior. β¨
π TAGS π
As mentioned above (iykyk π), constants can either be imported individually or in sets grouped by tag names. The tag names are:
fxpβ imports all of theSSH2_FXP_*constants. these are the constants used in the messaging protocol. the texters of the constant world fr fr. π¬flagsβ imports all of theSSH2_FXF_*constants. these are the constants used as flags sent to the server when opening files. π©attβ imports all of theSSH2_FILEXFER_ATTR_*constants. these are the constants used to construct the flag in the serialized attributes. The flag describes what types of file attributes are listed in the buffer. very "what's in the bag" energy. πstatusβ imports all of theSSH2_FX_*constants. these are constants returned from a serverSSH2_FXP_STATUSmessage, and they indicate the status of a particular operation. it's giving "read receipt". β
π and there is one constant that does not fit into any of the tag sets: SSH2_FILEXFER_VERSION, which holds the value of the SFTP protocol implemented by Net::SFTP. she's a solo act. no group chat for her. π
π AUTHOR & COPYRIGHTS π
Please see the Net::SFTP manpage for author, copyright, and license information. all the legal bestie stuff lives over there. π«Ά
perl v5.42.0 π 2025-07-25 β that's the version and the date, bestie, straight from the source, no cap. mwah π stay slaying those constants β¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Net-SFTP 0.12-22.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms