Smith Jeff D wrote:
>       I am trying to copy/move files under WinNT from remote server(s) to
> a central server using File::Copy --see code snippet below:
> 
> snippet begins------
> use File::Copy;
> ......
> 
> open (LOGFILE, ">>testlog") or die (print "$! problem opening
> testlog\n"); print LOGFILE "$date: \n";
> print LOGFILE "This is a test of moving a handle--ONCE AGAIN\n";
> print LOGFILE "the end\n";
> 
> #my $result = copy ($fromdir, $todir) or die ("Error--can't copy
> LogFile : $!\n");
> my $result = move (\*LOGFILE, $todir) or die ("Error--can't move the
> LogFile: $!\n");
> 
> 
> close (LOGFILE);
> 
> .......
> 
> 
> 
> 
> 
> snippet ends----
> 
>       It works fine when I pass it a literal reference for the source and
> destination using copy or move commands.  However, I can't get a
> reference to a file handle to work.  There must be something really
> simple that I'm missing.  I know that it's not a permissions issue
> and I know the file does get created once I've closed the File
> Handle.  I'd like to keep the file handle open though so that I can
> grab the contents of the File Handle for another routine.  the move
> command always returns 0 when referencing the LOGFILE file handle.  
> I'd like to use move so I don't have to copy the files and remove
> them from the source directory afterwards. 
> 
> Thanks
> 
> Jeff Smith

  Jeff, I am running 5.6.0 but when I look at copy using filehandle I see :


        use File::Copy cp;        
          $n=FileHandle->new("/dev/null","r");
        cp($n,"x");'

 which is not what you are trying.  You are trying to use an already open file and 
that I don't believe is the context of what I see in the doc. The group can correct me 
( and they will) if I am wrong.

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for 
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to