Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   File::Copy works, File::NCopy doesn't (http://www.velocityreviews.com/forums/t894213-file-copy-works-file-ncopy-doesnt.html)

 Christopher Benson-Manica 09-13-2005 01:56 PM

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

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.

 A. Sinan Unur 09-13-2005 09:56 PM

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

Christopher Benson-Manica <ataru@nospam.cyberspace.org> wrote in
news:dg6lpu$oh$1@chessie.cirr.com:

> 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 <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:

 A. Sinan Unur 09-14-2005 02:32 AM

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

Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in news:130920051853345704%
jgibson@mail.arc.nasa.gov:

> In article <Xns96D0B67CEB50Dasu1cornelledu@127.0.0.1>, A. Sinan Unur
> <1usa@llenroc.ude.invalid> 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 <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:

 xhoster@gmail.com 09-14-2005 03:10 AM

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

Jim Gibson <jgibson@mail.arc.nasa.gov> wrote:
> In article <Xns96D0B67CEB50Dasu1cornelledu@127.0.0.1>, A. Sinan Unur
> <1usa@llenroc.ude.invalid> 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

 A. Sinan Unur 09-14-2005 07:29 PM

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

Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in
news:140920051220580568%jgibson@mail.arc.nasa.gov:

> 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

 All times are GMT. The time now is 01:15 PM.