Net::S...nstants(3pm)

πŸ“¦
version 1.93 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 the SSH2_FXP_* constants πŸ’« these are the constants used in the messaging protocol.
  • :flags β€” imports all of the SSH2_FXF_* constants ✨ these are 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.
  • :status β€” imports all of the SSH2_FX_* constants 🌈 these are constants returned from a server SSH2_FXP_STATUS message and indicate the status of a particular operation.
  • :error β€” imports all the SFTP_ERR_* constants used to represent high level errors πŸ”₯ and the full list is:
    • SFTP_ERR_LOCAL_ALREADY_EXISTS
    • SFTP_ERR_LOCAL_CHMOD_FAILED
    • SFTP_ERR_LOCAL_OPEN_FAILED
    • SFTP_ERR_LOCAL_READ_ERROR
    • SFTP_ERR_LOCAL_STAT_FAILED
    • SFTP_ERR_LOCAL_UTIME_FAILED
    • SFTP_ERR_LOCAL_WRITE_FAILED
    • SFTP_ERR_REMOTE_BAD_PACKET_SEQUENCE
    • SFTP_ERR_REMOTE_BAD_PERMISSIONS
    • SFTP_ERR_REMOTE_BAD_TIME
    • SFTP_ERR_REMOTE_BLOCK_TOO_SMALL
    • SFTP_ERR_REMOTE_CLOSE_FAILED
    • SFTP_ERR_REMOTE_FSETSTAT_FAILED
    • SFTP_ERR_REMOTE_FSTAT_FAILED
    • SFTP_ERR_REMOTE_LSTAT_FAILED
    • SFTP_ERR_REMOTE_MKDIR_FAILED
    • SFTP_ERR_REMOTE_OPENDIR_FAILED
    • SFTP_ERR_REMOTE_OPEN_FAILED
    • SFTP_ERR_REMOTE_READDIR_FAILED
    • SFTP_ERR_REMOTE_READ_FAILED
    • SFTP_ERR_REMOTE_REALPATH_FAILED
    • SFTP_ERR_REMOTE_REMOVE_FAILED
    • SFTP_ERR_REMOTE_RENAME_FAILED
    • SFTP_ERR_REMOTE_RMDIR_FAILED
    • SFTP_ERR_REMOTE_READLINK_FAILED
    • SFTP_ERR_REMOTE_SYMLINK_FAILED
    • SFTP_ERR_REMOTE_SETSTAT_FAILED
    • SFTP_ERR_REMOTE_STAT_FAILED
    • SFTP_ERR_REMOTE_WRITE_FAILED
    • SFTP_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 the SSH2_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 by Net::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