Net::SFTP::Foreign::Attributes - File/directory attribute container
use Net::SFTP::Foreign; my $a1 = Net::SFTP::Foreign::Attributes->new(); $a1->set_size($size); $a1->set_ugid($uid, $gid); my $a2 = $sftp->stat($file) or die "remote stat command failed: ".$sftp->status; my $size = $a2->size; my $mtime = $a2->mtime;
Net::SFTP::Foreign::Attributes encapsulates file/directory attributes for Net::SFTP::Foreign. It also provides serialization and deserialization methods to encode/decode attributes into Net::SFTP::Foreign::Buffer objects.
Returns a new Net::SFTP::Foreign::Attributes object.
Net::SFTP::Foreign::Attributes
Creates a new attributes object and populates it with information read from $buffer.
$buffer
Serializes the Attributes object $attrs into a buffer object.
returns the value of the flags field.
returns the values of the size field or undef if it is not set.
returns the value of the uid field or undef if it is not set.
returns the value of the gid field or undef if it is not set.
returns the value of the permissions field or undef if it is not set.
returns the value of the atime field or undef if it is not set.
returns the value of the mtime field or undef if it is not set.
sets the value of the size field, or if $size is undef removes the field. The flags field is adjusted accordingly.
sets the value of the permsissions field or removes it if the value is undefined. The flags field is also adjusted.
sets the values of the uid and gid fields, or removes them if they are undefined values. The flags field is adjusted.
This pair of fields can not be set separatelly because they share the same bit on the flags field and so both have to be set or not.
sets the values of the atime and mtime fields or remove them if they are undefined values. The flags field is also adjusted.
Copyright (c) 2006 Salvador Fandiño.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::SFTP::Foreign, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SFTP::Foreign
CPAN shell
perl -MCPAN -e shell install Net::SFTP::Foreign
For more information on module installation, please visit the detailed CPAN module installation guide.