NAME
Rex::FS::File - File Class
DESCRIPTION
This is the File Class used by file_write and file_read.
SYNOPSIS
my $file = Rex::FS::File->new(fh => $fh);
$file->read($len);
$file->read_all;
$file->write($buf);
$file->close;
CLASS METHODS
- new
-
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)
-
Write $buf into the filehandle.
$file->write("Hello World");
- seek($offset)
-
Seek to the file position $offset.
Set the file pointer to the 5th byte.
$file->seek(5);
- read($len)
-
Read $len bytes out of the filehandle.
my $content = $file->read(1024);
- read_all
-
Read everything out of the filehandle.
my $content = $file->read_all;
- close
-
Close the file.
$file->close;