VCS::LibCVS::Datum::FileContents - File contents for use in CVS
$fc = VCS::LibCVS::Datum::FileContents->new("/cvs/dir/new.c"); $rq = VCS::LibCVS::Client::Request::Modified->new(["new.c",$mode,$fc]);
Datum::FileContents presents the contents of a file in a way which is suitable for the various purposes of LibCVS. Important aspects are the transmission of the length of the file before the contents of the file itself, and the conversion of line terminators.
A Datum::FileContents does not consist of a group of lines, so it is handled differently from the others and it overrides most of the class routines.
VCS::LibCVS::Datum
$arg = Datum::FileContents->new($data)
An IO::Handle object from which the file data will be read. The file data must arrive over the IO::Handle in the same manner as the CVS protocol, ie. a file length in bytes followed by newline followed by the file transmission.
The name of a file in the local file system. This file will not be read until the Datum is accessed, so if it changes results may be unpredictable.
If the argument is already a Datum::FileContents object, it will be returned. It will not be copied.
If the hash ref contains a parameter named 'scalar', it will be used as the entire contents of the file.
Construct a new Datum::FileContents. The IO::Handle option is generally used when reading responses from the server, the others when constructing requests.
$datum->as_string()
Returns the file contents as a scalar, which should not be modified.
$file_contents = $datum->as_protocol_string()
Returns the Datum::FileContents as a string suitable for being sent to the server: filelength, newline, filecontents.
To install VCS::LibCVS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VCS::LibCVS
CPAN shell
perl -MCPAN -e shell install VCS::LibCVS
For more information on module installation, please visit the detailed CPAN module installation guide.