Hey Carl -

I got in a hurry and did some cut and paste without paying close enough attention.

The line should read

my $dir = 'C:\GIS\wrapped_data';


I apologize for the error.

Mark



got this error line 9 near "= ="
aborted due to compilation error

*/Mark Taylor <[EMAIL PROTECTED]>/* wrote:

     > Hello group,

    Hello.

     >
     > 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";
     > 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;
     >


Try this, my $dir = = 'C:\GIS\wrapped_data' instead.


HTH, Mark





*Carl Johnson*
*Principal Consultant*
*214-914-9509 - P*
*214-242-2020 - F*
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>*


--
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