-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jorge
Palma
Sent: Thursday, September 08, 2005 10:16 AM
To: [email protected]
Subject: Fw: writing file in binary mode

Sorry,
here is the part where a write to the file.

The problem is it write ok, but in text mode and not in binary mode.

Thanks

# --- open and read all text file and put it in array
    open(FileIn,"$dirBase\\PSData_21.txt"), or die;
         @lines=<FileIn>;
     close (FileIn);

# --- open outfile in binary mode
        open (FileOut, ">>$dirBase\\PSData_mwd_21");
        binmode (FileOut);
        ...

        print FileOut "$stid $rlat $rlon $tim $nlev $nflag\n" ;
        ...
-----Original Message-----


My guess is that you want the data to be converted to binary
AND then output.  You will need to read the ASCII data, break
it into variables, then "pack" it into binary data and
finally output.




_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to