DiaColloDB

 view release on metacpan or  search on metacpan

DiaColloDB/Utils.pod  view on Meta::CPAN


 $mtime = PACKAGE->file_mtime($file_or_fh);

get mtime (last modification time) for $file_or_fh.

=item file_timestamp

 $timestamp = PACKAGE->file_timestamp($file_or_fh);

get an ISO-8601 timestamp for mtime of $file_or_fh.

=item du_file

 $nbytes = du_file(@filenames_or_fhs);

return number of bytes used by @filesnames_or_fhs

=item du_glob

 $nbytes = du_glob(@globs);

return number of bytes used by files matching and $glob in @globs

=item copyto

 $bool = PACKAGE->moveto($src_filename_or_array, $dstdir, %opts);

Copies source file(s) to C<$dstdir>, creating C<$dstdir> if it doesn't already exist.
Argument C<$src_filename_or_array> may be either a ARRAY-ref of filenames to be copied or
a single scalar filename.
By default, files are copied using L<File::Copy::copy()|File::copy/copy>.
Options %opts:

 from   => $from,      ##-- replace prefix $from in file(s) with $todir; default=undef: flat copy to $todir
 method => \&method,   ##-- use CODE-ref \&method as underlying copy routing; default=\&File::Copy::copy
 label  => $label,     ##-- report errors as '$label'; (default='copyto()')

=item copyto_a

 $bool = PACKAGE->copyto_a($src_filename_or_array, $dstdir, %opts);

Wrapper for C<L<PACKAGE-E<gt>copyto|/copyto>($src_filename_or_array, $dstdir, %opts, method=E<gt>\&L<cp_a|/cp_a>, label=E<gt>'moveto()')>.

=item moveto

 $bool = PACKAGE->moveto($src_filename_or_array, $dstdir, %opts);

Wrapper for C<L<PACKAGE-E<gt>copyto|/copyto>($src_filename_or_array, $dstdir, %opts, method=E<gt>\&L<File::Copy::move|File::Copy/move>, label=E<gt>'moveto()')>.

=item cp_a

 $bool = PACKAGE->cp_a($src,$dst);

Copies a single file C<$src> to C<$dst>, attempting to preserve ownership, permissions, and timestamps;
used by L<copyto_a()|/copyto_a>.
Uses L<File::Copy::syscopy()|File::Copy/syscopy> if available and distinct from
L<File::Copy::copy()|File::Copy/copy>, otherwise first copies the file using
L<File::Copy::copy()|File::Copy/copy> and subsequently propagates file attributes using
the core perl functions
L<chown()|perlfunc/chown>,
L<chmod()|perlfunc/chmod>,
and L<utime()|perlfunc/utime>.

=item fh_flush

 $fh_or_undef = PACKAGE->fh_flush($fh);

flushes filehandle $fh using its flush() method if available

=item fh_reopen

 $fh_or_undef = PACKAGE->fh_reopen($fh,$file);

closes and re-opens filehandle $fh, should be an expensive flush even if system doesn't
support the IO::Handle::flush method.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Utils: Utils: SI
=pod

=head2 Utils: SI

=over 4

=item si_str

 $str = si_str($float);

returns an SI string for $float.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Utils: Functions: pdl: setops
=pod

=head2 Functions: pdl

=over 4

=item _intersect_p

 $pi = CLASS::_intersect_p($p1,$p2);
 $pi = CLASS->_intersect_p($p1,$p2);

computes intersection of 2 piddles; undef is treated as the universal set;
argument piddles MUST be sorted in ascending order.

=item _union_p

 $pu = CLASS::_union_p($p1,$p2);
 $pu = CLASS-E<gt>_intersect_p($p1,$p2);

computes union of 2 piddles; undef is treated as the universal set;
argument piddles MUST be sorted in ascending order.



( run in 0.550 second using v1.01-cache-2.11-cpan-39bf76dae61 )