Net::SF...nstants(3)

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

πŸ’– 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 the SSH2_FXP_* constants. these are the constants used in the messaging protocol. the texters of the constant world fr fr. πŸ’¬
  • flags β€” imports all of the SSH2_FXF_* constants. these are the constants used as flags sent to the server when opening files. 🚩
  • att β€” imports all of the SSH2_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 the SSH2_FX_* constants. these are constants returned from a server SSH2_FXP_STATUS message, 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