Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    File::Util 3.22

    Download button

    No screenshots available
    Downloads: 347  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Tommy Butler | More programs
    Perl Artistic License / FREE
    August 8th, 2007, 08:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    File::Util description

    File::Util is an easy, versatile, portable file handling module.

    File::Util is an easy, versatile, portable file handling module.

    File::Util provides a comprehensive toolbox of utilities to automate all kinds of common tasks on file / directories. Its purpose is to do so in the most portable manner possible so that users of this module won't have to worry about whether their programs will work on other OSes and machines.

    SYNOPSIS

    use File::Util;
    my($f) = File::Util->new();

    my($content) = $f->load_file('foo.txt');

    $content =~ s/this/that/g;

    $f->write_file(
    'file' => 'bar.txt',
    'content' => $content,
    'bitmask' => 0644
    );

    $f->write_file(
    'file' => 'file.bin', 'content' => $binary_content, '--binmode'
    );

    my(@lines) = $f->load_file('randomquote.txt', '--as-lines');
    my($line) = int(rand(scalar @lines));

    print $lines[$line];

    my(@files) = $f->list_dir('/var/tmp', qw/ --files-only --recurse /);
    my(@textfiles) = $f->list_dir('/var/tmp', '--pattern=.txt$');

    if ($f->can_write('wibble.log')) {

    my($HANDLE) = $f->open_handle(
    'file' => 'wibble.log',
    'mode' => 'append'
    );

    print $HANDLE "Hello World! It's ", scalar localtime;

    close $HANDLE
    }

    my($log_line_count) = $f->line_count('/var/log/httpd/access_log');

    print "My file has a bitmask of " . $f->bitmask('my.file');

    print "My file is a " . join(', ', $f->file_type('my.file')) . " file."

    warn 'This file is binary!' if $f->isbin('my.file');

    print "My file was last modified on " .
    scalar localtime($f->last_modified('my.file'));

    # ...and _lots_ more

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    file handling | file utilities | Perl module | file | handling | utilities

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM