Rex::FS::File - File Class
This is the File Class used by write_file and read_file.
my $file = Rex::FS::File->new(fh => $fh); $file->read($len); $file->read_all; $file->write($buf); $file->close;
This is the constructor. You need to set the filehandle which the object should work on.
my $file = Rex::FS::File->new(fh => $fh);
Write $buf into the filehandle.
$file->write("Hello World");
Seek to the file position $offset.
Set the file pointer to the 5th byte.
$file->seek(5);
Read $len bytes out of the filehandle.
my $content = $file->read(1024);
Read everything out of the filehandle.
my $content = $file->read_all;
Close the file.
$file->close;
To install Rex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rex
CPAN shell
perl -MCPAN -e shell install Rex
For more information on module installation, please visit the detailed CPAN module installation guide.