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

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

1. Christopher Benson-ManicaGuest

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

2. A. Sinan UnurGuest

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:

A. Sinan Unur, Sep 13, 2005

3. A. Sinan UnurGuest

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:

A. Sinan Unur, Sep 14, 2005
4. 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

--
Usenet Newsgroup Service \$9.95/Month 30GB

, Sep 14, 2005
5. A. Sinan UnurGuest

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