Net::S...nstants(3pm)
β¨ NAME β¨
bestie, this is Net::SFTP::Foreign::Constants β the constant definitions for Net::SFTP::Foreign π (it lives in the Perl manual pages, perl v5.32.0 era, she's a whole legend).
πΈ SYNOPSIS πΈ
use Net::SFTP::Foreign::Constants qw(:tag SSH2_FILEXFER_VERSION);
print "Protocol version is ", SSH2_FILEXFER_VERSION;
okay so that's the whole vibe: pull in a tag, or pull in one single constant, and go π¦
π DESCRIPTION π
Net::SFTP::Foreign::Constants hands you a whole lil' treasure chest of exportable SFTP constants, no cap: constants for SFTP messages and commands, for file-open flags, for status messages, etc. You can export them one at a time, or in cute lil' bundles identified by tag names π
And here's the tea: Net::SFTP::Foreign::Constants provides values for all of the constants listed in the SFTP protocol version 3 draft. The only thing to note is that the constants are listed with the prefix SSH2_ instead of SSH_ π so, for example, to import the constant for the file-open command, you would write:
use Net::SFTP::Foreign::Constants qw( SSH2_FXP_OPEN );
not me obsessing over a prefix. but like, that's it. that's the whole twist π
π·οΈ TAGS π·οΈ
as mentioned above (yes I said it, keep up bestie), 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.:flagsβ imports all of theSSH2_FXF_*constants β¨ these are 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.:statusβ imports all of theSSH2_FX_*constants π these are constants returned from a serverSSH2_FXP_STATUSmessage and indicate the status of a particular operation.:errorβ imports all theSFTP_ERR_*constants used to represent high level errors π₯ and the full list is:SFTP_ERR_LOCAL_ALREADY_EXISTSSFTP_ERR_LOCAL_CHMOD_FAILEDSFTP_ERR_LOCAL_OPEN_FAILEDSFTP_ERR_LOCAL_READ_ERRORSFTP_ERR_LOCAL_STAT_FAILEDSFTP_ERR_LOCAL_UTIME_FAILEDSFTP_ERR_LOCAL_WRITE_FAILEDSFTP_ERR_REMOTE_BAD_PACKET_SEQUENCESFTP_ERR_REMOTE_BAD_PERMISSIONSSFTP_ERR_REMOTE_BAD_TIMESFTP_ERR_REMOTE_BLOCK_TOO_SMALLSFTP_ERR_REMOTE_CLOSE_FAILEDSFTP_ERR_REMOTE_FSETSTAT_FAILEDSFTP_ERR_REMOTE_FSTAT_FAILEDSFTP_ERR_REMOTE_LSTAT_FAILEDSFTP_ERR_REMOTE_MKDIR_FAILEDSFTP_ERR_REMOTE_OPENDIR_FAILEDSFTP_ERR_REMOTE_OPEN_FAILEDSFTP_ERR_REMOTE_READDIR_FAILEDSFTP_ERR_REMOTE_READ_FAILEDSFTP_ERR_REMOTE_REALPATH_FAILEDSFTP_ERR_REMOTE_REMOVE_FAILEDSFTP_ERR_REMOTE_RENAME_FAILEDSFTP_ERR_REMOTE_RMDIR_FAILEDSFTP_ERR_REMOTE_READLINK_FAILEDSFTP_ERR_REMOTE_SYMLINK_FAILEDSFTP_ERR_REMOTE_SETSTAT_FAILEDSFTP_ERR_REMOTE_STAT_FAILEDSFTP_ERR_REMOTE_WRITE_FAILEDSFTP_ERR_REMOTE_HARDLINK_FAILED
heads up bestie π«Ά Note: these constants are not defined on the SFTP draft. so like, they're extra credit, not canon.
:extβ import all theSSH2_FXE_*constants π§ these are the constants defined for usage with SFTP extensions.
currently, these are supported: SSH2_FXE_STATVFS_ST_RDONLY, SSH_FXE_STATVFS_ST_NOSUID.
and then there's one constant that does NOT fit into any of the tag sets π it's the lone wolf, the main character:
SSH2_FILEXFER_VERSIONβ holds the value of the SFTP protocol implemented byNet::SFTP::Foreign.
literally the only one flying solo. respect. π
π AUTHOR & COPYRIGHTS π
please see the Net::SFTP::Foreign manpage for author, copyright, and license information π (they said "see the other page" and honestly? valid. go read it.)
okay that's the whole page bestie, mwah π β¨
sign-off time: this was perl v5.32.0, dated 2021-01-23, and it's the Net::SFTP::Foreign::Constants page (the manual header was being all mysterious with Net::S...nstants(3pm), we love a dramatic ellipsis). bye babes π¦πΈ
π¦ where this page comes from
- debian bookworm: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms