CTKlib

 view release on metacpan or  search on metacpan

lib/CTK/Plugin/File.pm  view on Meta::CPAN

    -file => "file1.txt"

Name of file

    -regexp => qr/\.(cgi|pl)$/i

Regexp

Default: undef (all files)

=item B<-limit>, B<-lines>, B<-rows>, B<-n>

    -lines => 5

Splits file by 5 lines

=item B<-format>, B<-callback>, B<-cb>

    -format => "[COUNT]_[FILE].copy[TIME].part[PART]"

Specifies format for output file

    -callback => sub {
        my $input_file_name = shift;
        my $input_file_number = shift;
        my $output_file_number = shift; # Part number
        ...
        return $file_name;
    }

Callbacks allows you to modify the name of the output file manually

Default: "[FILE].part[PART]"

=back

Replacing keys: FILE, COUNT, TIME, PART

=back

=head2 REPLACING KEYS

=over 8

=item B<FILE>

Path and filename

=item B<FILENAME>

Filename only

=item B<FILEEXT>

File extension only

=item B<COUNT>

Current number of file in sequence (for fcopy and fmove methods)

For fsplit method please use perl mask %i

=item B<TIME>

Current time value (unix-time format, time())

=back

=head1 HISTORY

See C<Changes> file

=head1 DEPENDENCIES

L<CTK>, L<CTK::Plugin>, L<File::Find>, L<File::Copy>, L<Cwd>

=head1 TO DO

See C<TODO> file

=head1 BUGS

* none noted

=head1 SEE ALSO

L<CTK>, L<CTK::Plugin>

=head1 AUTHOR

Serż Minus (Sergey Lepenkov) L<https://www.serzik.com> E<lt>abalama@cpan.orgE<gt>

=head1 COPYRIGHT

Copyright (C) 1998-2022 D&D Corporation. All Rights Reserved

=head1 LICENSE

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

See C<LICENSE> file and L<https://dev.perl.org/licenses/>

=cut

use vars qw/ $VERSION /;
$VERSION = '1.03';

use base qw/CTK::Plugin/;

use CTK::Util qw/ :BASE /;
use Carp;
use File::Find;
use Cwd qw/getcwd abs_path/;
use File::Copy;
use Fcntl qw/ :flock /;
use Symbol;

use constant BUFFER_SIZE => 32 * 1024; # 32kB

__PACKAGE__->register_method(



( run in 0.849 second using v1.01-cache-2.11-cpan-483215c6ad5 )