Net::SF...tributes(3)

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

πŸ’– Net::SFTP::Attributes β€” the file/directory attribute container πŸ’–

okay bestie, gather round, because this one is the little container that holds all your file and directory attribute drama. It lives in the User Contributed Perl Documentation section of the manual, and no cap, it's lowkey essential if you're doing anything with Net::SFTP. πŸ¦‹


✨ NAME ✨

Net::SFTP::Attributes β€” a file/directory attribute container. That's it, that's the whole vibe. It holds attributes. Iconic behavior honestly. πŸ‘‘


🌸 SYNOPSIS 🌸

use Net::SFTP::Attributes;
my $attrs = Net::SFTP::Attributes->new(Stat => [ stat "foo" ]);
my $size = $attrs->size;

see how easy that was?? three lines and you're already slaying. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

So Net::SFTP::Attributes encapsulates file/directory attributes for Net::SFTP. Encapsulating!! she's keeping it all wrapped up and cozy. 🫢

She also comes with serialization and deserialization methods, which is a fancy way of saying she can encode/decode attributes into Net::SFTP::Buffer objects. so she's bilingual, basically. she speaks attribute and she speaks buffer. multilingual queen. 🌈


πŸ’œ USAGE πŸ’œ

⭐ Net::SFTP::Attributes->new( [ %args ] )

Constructs a brand new Net::SFTP::Attributes object and hands it right back to you. new object, who dis. ✨

%args is optional β€” if you don't pass it, the object gets initialized with the default values. no pressure, she's fine on her own. but if you do pass it, %args can contain:

  • Stat β€” a reference to the return value of the built-in stat function. The values in the Net::SFTP::Attributes object will be initialized from the values in the stat array, and the flags will be set appropriately. basically you're feeding her the receipts and she's filling in the blanks. πŸ“
  • Buffer β€” a Net::SFTP::Buffer object containing a serialized attribute object. The Net::SFTP::Attributes object will be initialized from the values in the serialized string, and flags will be set appropriately. she's decoding the mystery message fr fr. πŸ”₯

⭐ $attrs->as_buffer

Serializes the Attributes object $attrs into string form, using the flags in the object to determine what fields get placed in the buffer. Returns a Net::SFTP::Buffer object. she's packing her bags and the flags decide what she brings. πŸ’Όβœ¨

⭐ $attrs->flags( [ $value ] )

Get/set the value of the flags in $attrs. the flags are running the whole show here, they decide everything. main character energy tbh. πŸ‘‘

⭐ $attrs->size( [ $value ] )

Get/set the value of the file size (in bytes) in $attrs. in bytes!! don't forget the units bestie. πŸ“

⭐ $attrs->uid( [ $value ] )

Get/set the value of the UID in $attrs. user ID, keeping track of who you are. πŸͺͺ

⭐ $attrs->gid( [ $value ] )

Get/set the value of the GID in $attrs. group ID, your squad's official number. πŸ«‚

⭐ $attrs->perm( [ $value ] )

Get/set the value of the permissions in $attrs. who's allowed to do what, the whole access control situation. πŸ”

⭐ $attrs->atime( [ $value ] )

Get/set the value of the last access time (atime) in $attrs. when was she last visited?? the receipts are right here. πŸ•°οΈ

⭐ $attrs->mtime( [ $value ] )

Get/set the value of the last modified time (mtime) in $attrs. when did she last change?? glow-up timeline, documented. πŸ’…


πŸ“œ AUTHOR & COPYRIGHTS πŸ“œ

Please see the Net::SFTP manpage for author, copyright, and license information. all the legal tea lives over there, go check it out. 🧚


and that's the whole page!! every single option, every single method, nothing skipped, nothing invented. you understood the assignment. πŸŽ€

this little beauty shipped with perl v5.42.0, dated 2025-07-25 β€” so go forth and serialize your attributes, bestie. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from