IPC-PerlSSH
view release on metacpan or search on metacpan
lib/IPC/PerlSSH/Library/IO.pm view on Meta::CPAN
my $newpos = $ips->call( "seek", $fd, $pos, $whence )
You may find it useful to import the C<SEEK_*> constants from the C<Fcntl>
module.
=cut
func seek => q{
my $fh = get_handle( shift );
seek( $fh, $_[0], $_[1] ) or die "Cannot seek() - $!\n";
return tell($fh);
};
=head2 truncate
Truncates the file to the given length.
$ips->call( "truncate", $fd, $len );
=cut
func truncate => q{
my $fh = get_handle( shift );
$fh->truncate( $_[0] ) or die "Cannot truncate() - $!\n";
};
=head2 fstat
Returns the status of the file (see L<perldoc -f stat>).
my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
$mtime, $ctime, $blksize, $blocks ) = $ips->call( "fstat", $fd )
=cut
func fstat => q{
my $fh = get_handle( shift );
my @s = stat( $fh ) or die "Cannot stat() - $!\n";
@s;
};
=head2 fchmod
Change the permissions on the remote filehandle.
$ips->call( "fchmod", $fd, 0755 )
Note the order of arguments does not match perl's C<chmod()>.
Only works on versions of remote F<perl> 5.8.8 and above.
=cut
func fchmod => q{
die "Perl too old for fchmod()" if $] < 5.008008;
my $fh = get_handle( shift );
chmod( $_[0], $fh ) or die "Cannot chmod() - $!\n";
};
=head2 fchown
Changes the owner (and group) of the remote filehandle.
$ips->call( "fchown", $uid, $gid )
Note the order of arguments does not match perl's C<chown()>.
Only works on versions of remote F<perl> 5.8.8 and above.
=cut
func fchown => q{
die "Perl too old for fchown()" if $] < 5.008008;
my $fh = get_handle( shift );
chown( $_[0], $_[1], $fh ) or die "Cannot chown() - $!\n";
};
=head1 AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
=cut
0x55AA;
( run in 0.474 second using v1.01-cache-2.11-cpan-71847e10f99 )