Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    File::NCopy 0.36

    Download button

    No screenshots available
    Downloads: 533  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.9/5)
    19 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Gabor Egressy | More programs
    Perl Artistic License / FREE
    May 14th, 2008, 19:59 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    File::NCopy description

    File::NCopy is a Perl module to copy file[s] | dir[s], dir.

    File::NCopy is a Perl module to copy file[s] | dir[s], dir.

    SYNOPSIS

    use File::NCopy qw(copy);

    copy "file","other_file";
    copy "file1","file2","file3","directory";

    # we want to copy the directory recursively
    copy 1,"directory1","directory2";
    copy 1,"file1","file2","directory1","file3","directory2","file4",
    "directory";

    # can also use references to file handles, this is for backward
    # compatibility with File::Copy
    copy *FILE1,*FILE2;
    copy *FILE1,"file";
    copy "file1",*FILE2;


    # we don't specify 1 as the first argument because we don't want to
    # copy directories recursively
    copy "*.c","*.pl","programs";
    copy "*", "backup";

    use File::NCopy;

    # the below are the default config values
    $file = File::NCopy->new(
    'recursive' => 0,
    'preserve' => 0,
    'follow_links' => 0,
    'force_write' => 0,
    'set_permission' => &File::NCopy::u_chmod,
    'file_check' => &File::NCopy::f_check,
    'set_times' => &File::NCopy::s_times,
    );

    set_permission will take two file names, the original to get the
    file permissions from and the new file to set the file permissions
    for.

    file_check takes two parameters, the file names to check the file to
    copy from and the file to copy to. I am using flock for Unix
    systems.
    Default for this is &File::NCopy::f_check. On Unix you can also use
    &File::NCopy::unix_check. This one compares the inode and device
    numbers.

    set_times is used if the preserve attribute is true. It preserves
    the access and modification time of the file and also attempts to
    set the owner of the file to the original owner. This can be useful
    in a script used by root, though enyone can preserve the access and
    modification times. This also takes two arguments. The file to get
    the stats from and apply the stats to.

    On Unix boxes you shouldn't need to worry. On other system you may
    want to supply your own sub references.

    $file = File::NCopy->new(recursive => 1);
    $file->copy "file","other_file";
    $file->copy "directory1","directory2";

    $file = File::NCopy->new(u_chmod => &my_chmod,f_check => &my_fcheck);
    $file->copy "directory1","directory2";

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    copy files | copy directories | Perl module | Perl | copy | files

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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