Net::SFTP::Buffer(3)

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

✨ NAME ✨

ok so bestie, this is Net::SFTP::Buffer β€” it's the read/write buffer class πŸ’– that's the whole vibe, that's the whole job.


🌸 SYNOPSIS 🌸

use Net::SFTP::Buffer;
my $buffer = Net::SFTP::Buffer->new;

like. two lines. she's efficient. she's iconic. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” Net::SFTP::Buffer inherits from Net::SSH::Perl::Buffer, because it's out here providing read/write buffer functionality for SSH, periodt. And the way that SFTP buffers are literally exactly the same as SSH buffers?? no cap. same thing. same energy. πŸ’…

...except she's got a couple of additions, because she's that girl:

  • 64-bit integers β€” SFTP requires the use of 64-bit integers to represent very large file sizes, and in Net::SFTP::Buffer those 64-bit integers are implemented as Math::Pari objects. yes really. that's the implementation. 🧚
  • File attribute bundles β€” okay so attribute bundles are not strictly a simple data type, bestie. they're actually made up of smaller pieces β€” like 32-bit integers, 64-bit integers, etc. β€” but for matters of convenience, it is easiest to provide methods to directly serialize/deserialize attributes from buffers. so that's what we did. slay. πŸ’–

πŸ’œ USAGE πŸ’œ

ngl, usage of Net::SFTP::Buffer objects is exactly the same as usage of Net::SSH::Perl::Buffer objects 🫢 β€” with the additions of the following methods to support the above data types. that's it. that's the whole change. main character behavior only.

⭐ $buffer->get_int64

Extracts a 64-bit integer from $buffer and returns it as a Math::Pari object. she pulls it out and hands it to you, gift-wrapped. πŸŽ€

⭐ $buffer->put_int64($int)

Serializes a 64-bit integer $int into the buffer $buffer; and $int can be either a Math::Pari object or a built-in Perl integer β€” if it is small enough to fit into a Perl int. so like. know your limits bestie. πŸ™ˆ

⭐ $buffer->get_attributes

Uses Net::SFTP::Attributes to extract a list of file attributes from $buffer, and returns a Net::SFTP::Attributes object containing those file attributes. very demure, very mindful. πŸ’…

⭐ $buffer->put_attributes($attrs)

Serializes a Net::SFTP::Attributes object $attrs into the buffer $buffer. put her in, she belongs there. ✨


πŸ‘‘ AUTHOR & COPYRIGHTS πŸ‘‘

Please see the Net::SFTP manpage for author, copyright, and license information. go read it, iykyk 🫢


and that's the whole page babes β€” this one's from perl v5.42.0, dated 2025-07-25, part of the User Contributed Perl Documentation collection. mwah. go forth and buffer responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from