in reply to File NCopy concat

What is copy?


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: File NCopy concat
by hgolden (Pilgrim) on Sep 14, 2006 at 22:43 UTC
    He might be using File::Copy...
      Yes, its actually File::NCopy.... the files needs to have space in them. So Im trying a find a way to do this keeping the spaces in.

        Try using File::Copy instead. File::NCopy seems to be broken.

        Update: the following illustrates the issue:

        use strict; use warnings; use File::Copy; use File::NCopy; use constant FILENAME_1 => 'File with spaces in the name.txt'; use constant FILENAME_2 => 'File with spaces in the name2.txt'; use constant FILENAME1 => 'Filename.txt'; use constant FILENAME2 => 'Filename2.txt'; open outFile, '>', FILENAME1; print outFile "Some text in non-spaced out file\n"; close outFile; open outFile, '>', FILENAME_1; print outFile "Some text in the spaced out file\n"; close outFile; File::NCopy::copy (FILENAME1, FILENAME2) or warn "Non-spaced to non-sp +aced failed with NCopy\n"; File::NCopy::copy (FILENAME_1, FILENAME2) or warn "Spaced to non-space +d failed with NCopy\n"; File::NCopy::copy (FILENAME1, FILENAME_2) or warn "Non-spaced to space +d failed with NCopy\n"; File::NCopy::copy (FILENAME_1, FILENAME_2) or warn "Spaced to spaced f +ailed with NCopy\n"; File::Copy::copy (FILENAME1, FILENAME2) or warn "Non-spaced to non-spa +ced failed with Copy\n"; File::Copy::copy (FILENAME_1, FILENAME2) or warn "Spaced to non-spaced + failed with Copy\n"; File::Copy::copy (FILENAME1, FILENAME_2) or warn "Non-spaced to spaced + failed with Copy\n"; File::Copy::copy (FILENAME_1, FILENAME_2) or warn "Spaced to spaced fa +iled with Copy\n";

        prints:

        Spaced to non-spaced failed with NCopy Spaced to spaced failed with NCopy

        DWIM is Perl's answer to Gödel