I'm using Win32::FileOp to copy a file to a remote machine.
I've shared a directory on the remote machine, and this copy
command works nicely when the network is up and everybody
plays together:

 eval {
  $return = Copy ($copy_from => $copy_to );
  };

To simulate network down for error handling, I stopped sharing
the remote drive. Now the fun begins. I get a windows popup,
which I'd like to switch off, since this will be run as a scheduled
process, and I'd like to be able to capture and log any errors.

The documentation around setting constants is confusing to me:

  Copy ($FileName => $FileOrDirectoryName [, ...])

That last bit, [, ...], is causing me confusion. Do the square
brackets indicate an anonymous array is expected? Or do they indicate
contents  are optional?

Anyhow, I've tried lots of variations, but haven't stumbled across any
format that works. For example:

 eval {
  $return = Copy ($copy_from => $copy_to, 'FOF_NOERRORUI' );
  };

Eval returns a "wrong number of arguments" message on that one.

Hints?

===========================

Weird error behavior. When I run the code that works, without trying
to set the constant, NONE of my error capturing attempts work.
The remote share is still turned off for this:

 eval {
  $return = Copy ($copy_from => $copy_to );
  };

There is a complaint about network down that goes to the popup,
but when I click thru popup, there's no eval error, $^E is set to
nothing, and Win32::FormatMessage(Win32::GetLastError())
likewise does not get set.

Hints?


best,

 /dennis

------------------------------------------------
Phone: 317.298.6049
------------------------------------------------
If I'm not here, it means I've gone out to find myself. If I get back
before I return, please keep me here.


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to