Carl Johnson wrote:
> Hello group,
> 
> I'm trying to read the directory "C:\GIS\wrapped_data" and write
> record. My scripts is erroring with "can't open directory: no such 
> file or directory. What am I missing?  
> 
> $outfile = "$infile.txt";
> my $dir = "C:\GIS\wrapped_data";
        With double quotes, what perl is seeing is C:GISwrapped_data which is 
not what you wnat. Change to single quotes or switch / and it will work as you 
want.

Wags ;)
> opendir(DIR,"$dir") or die "Can't open $dir directory: $!";
> open (OUT, ">$outfile") or die "Error, cannot open file: $outfile.
> $!"; $record = "";
> $index=0;
> while ( $numbytes = read(DIR, $record, 1200) ) {
>    $index++;
>    if ($numbytes == 1200) {
>       print OUT "$record";
>    } else {
>       die "File Read Error on record $index: $numbytes bytes read;
>    Should be 1200.\n"; }
> }
> close DIR;
> close OUT;
> 
> 
> 
> 
> Carl Johnson
> Principal Consultant
> 214-914-9509 - P
> 214-242-2020 - F
> [EMAIL PROTECTED]



*******************************************************
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]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to