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

  • Thread starter Christopher Benson-Manica
  • Start date
C

Christopher Benson-Manica

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).
 
A

A. Sinan Unur

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

A. Sinan Unur

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
 
X

xhoster

Jim Gibson said:
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
 
A

A. Sinan Unur

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top