InSilicoSpectro::Utils::io - InSilicoSpectro::Utils::io documentation


InSilicoSpectro documentation  | view source Contained in the InSilicoSpectro distribution.

Index


NAME

Top

InSilicoSpectro::Utils::io

DESCRIPTION

Top

Miscelaneous I/O utilities.

FUNCTIONS

Top

getFD()

The getFD function takes either a file string, a piped command or a file description as argument and returns a file descriptor. In case of error while opening, it returns undef.

uncompressFile($fname, [\%args])

Uncompresses a gziped file. Returns the new uncompressed file name; Erase the original; %args can overwrite default values

remove => [1];
dest => filename [undef];

If defined, the uncompressed file is not the original one =~s/\.gz$//i, but it has this file name.

headGz($fname, [$nblines], [$re])

Uncompresses file $fname and takes the $nblines first lines (default 10) satisfying regular expression $re (if defined).

Returns either an array or lines concatenated with \n characters, depending on the context.

compressFile($fname, [\%args])

Compresses to a gziped file. Returns the new compressed file name; Erases the original by default; %args can overwrite default values.

remove => [1];

zipFiles($dest, \@files, [$baseNameOnly])

Opens a zip archive $dest and puts all the files contained in @files into it. $dest can be either undef (means STDOUT), or a filehandle, or a file name. If($baseNameOnly) [default undef], stores the file under its basename (removes directory name).

getMD5($file)

Returns a MD5 checksum of $file.

croakIt($msg)

Croaks with the given message, but appends a stack trace if $InSilicoSpectro::Utils::io::VERBOSE is true.

COPYRIGHT

Top

AUTHORS

Top

Alexandre Masselot, www.genebio.com


InSilicoSpectro documentation  | view source Contained in the InSilicoSpectro distribution.