Dennis Daupert wrote:
>
>
> 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?
>
>   
The docs 
http://search.cpan.org/src/JENDA/Win32-FileOp-0.10.4/FileOp.pm.html 
would suggest that [,...] is for another set of  File2 => 
Filedestination2, for the Copy command.

> 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.
>   
The docs have this:
Copy
    Copy ($FileName => $FileOrDirectoryName [, ...])
    Copy ([EMAIL PROTECTED] => $DirectoryName [, ...] )
   Copy ([EMAIL PROTECTED] => [EMAIL PROTECTED] [, ...])

    Copies the specified files. Doesn't show any confirmation nor 
progress dialogs.

    **It may show an error message dialog, because I had to omit 
FOF_NOERRORUI from its call to allow for autocreating directories.**

It looks like there is another  command (CopyEx) , which will take the 
FOF options.  Also, the FOF* options are exported subroutines from 
FileOP, so they don't need to be quoted.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to