File::Copy works, File::NCopy doesn't

Discussion in 'Perl Misc' started by Christopher Benson-Manica, Sep 13, 2005.

  1. I have a situation where I invoke File::Copy and File::NCopy with
    identical arguments - I am attempting to copy a file from one network
    path to another, something like

    copy( "\\\\$somepath\\foo\\bar.txt", "\\\\$someotherpath\\foo\\bar.txt" );

    File::Copy works fine, but File::NCopy says "No such file or
    directory". Can NCopy's copy not handle network paths? (This is
    ActiveState Perl 5.8.7 for WinXP).

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
     
    Christopher Benson-Manica, Sep 13, 2005
    #1
    1. Advertising

  2. Christopher Benson-Manica <> wrote in
    news:dg6lpu$oh$:

    > I have a situation where I invoke File::Copy and File::NCopy with
    > identical arguments - I am attempting to copy a file from one network
    > path to another, something like
    >
    > copy( "\\\\$somepath\\foo\\bar.txt",
    > "\\\\$someotherpath\\foo\\bar.txt" );
    >
    > File::Copy works fine, but File::NCopy says "No such file or
    > directory". Can NCopy's copy not handle network paths? (This is
    > ActiveState Perl 5.8.7 for WinXP).


    I don't know anything about File::NCopy, but did you try enabling debug
    mode?

    my $fcopy = File::NCopy('_debug' => 1);

    $fcopy->copy( ... );

    On the other hand, I do not find it encouraging that the module author
    uses print for debug messages. He should be using warn.

    Sinan

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Sep 13, 2005
    #2
    1. Advertising

  3. Jim Gibson <> wrote in news:130920051853345704%
    :

    > In article <Xns96D0B67CEB50Dasu1cornelledu@127.0.0.1>, A. Sinan Unur
    > <> wrote:
    >
    >
    >>
    >> On the other hand, I do not find it encouraging that the module author
    >> uses print for debug messages. He should be using warn.

    >
    > Why is that? Why do you want to write debugging messages to standard
    > error instead of standard output?


    So that I can actually see the debugging messages even if standard output
    is redirected. Or, so that I can log debugging messages to a file
    separately from the normal output of the program.

    Sinan

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Sep 14, 2005
    #3
  4. Christopher Benson-Manica

    Guest

    Jim Gibson <> wrote:
    > In article <Xns96D0B67CEB50Dasu1cornelledu@127.0.0.1>, A. Sinan Unur
    > <> wrote:
    >
    > >
    > > On the other hand, I do not find it encouraging that the module author
    > > uses print for debug messages. He should be using warn.

    >
    > Why is that? Why do you want to write debugging messages to standard
    > error instead of standard output?


    Because a lot of Perl program write a lot of stuff to STDOUT. Indeed, that
    is often their main purpose. Good programs write little if anything to
    STDERR, so you should probably send dubugging output there, where it will
    be easy to find. Besides, you want to debug things because you suspect
    there are ERRors.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Sep 14, 2005
    #4
  5. Jim Gibson <> wrote in
    news:140920051220580568%:

    > My method works for me and the kind of programs I write and the kind
    > of debugging I do, and I am sure that your method works for you.
    > However, this seems more of a personal preference issue, and not
    > something that you would cause you to denigrate a module. It would
    > seem to me that debug print statements in a module are mostly for the
    > benefit of the author and are not cause for criticism. The lack or
    > content of debug statements would be a concern to me, not where they
    > are directed.


    And, when a module does not do something the user expects it to be able to,
    then the debug statements can help the user of the module as well.

    It's fine by me if you want to claim this is a personal preference, but
    common sense tells me, usual output goes to STDOUT, and errors/logging go
    to STDERR.

    Sinan
     
    A. Sinan Unur, Sep 14, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    2
    Views:
    1,274
  2. Gary
    Replies:
    6
    Views:
    521
    Richard
    Aug 6, 2006
  3. Replies:
    26
    Views:
    2,160
    Roland Pibinger
    Sep 1, 2006
  4. Christopher Benson-Manica

    File::NCopy question

    Christopher Benson-Manica, Sep 12, 2005, in forum: Perl Misc
    Replies:
    9
    Views:
    331
    A. Sinan Unur
    Sep 13, 2005
  5. MaggotChild

    File::Copy::copy With File Handles

    MaggotChild, Oct 18, 2011, in forum: Perl Misc
    Replies:
    2
    Views:
    522
    Ilya Zakharevich
    Oct 22, 2011
Loading...

Share This Page