comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Problem in reading binary file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problem in reading binary file [message #80665 is a reply to message #80637] Wed, 27 June 2012 01:50 Go to previous messageGo to previous message
hadi is currently offline  hadi
Messages: 33
Registered: June 2012
Member
On Wednesday, June 27, 2012 5:15:12 PM UTC+9, Mats Löfdahl wrote:
> Den onsdagen den 27:e juni 2012 kl. 09:48:41 UTC+2 skrev fada...@gmail.com:
>> Dear all
>> I have a problem to reading a binary file that has been written by Fortran program. how I can read the binary file from fortran program. I run this command and i got this error. please see it my problem and give me solution. I am appreciating in advance. please look the program.
>> infile = 'C:/Users/fadaei/IDLWorkspace80/DEM.dat' ;Input file name
>> IDL>
>> IDL> OPENR, iunit, infile, /GET_LUN ;Open input file
>> IDL>
>> IDL> n = 0 ;Make n a LONG
>> IDL> m = 0 ;Make m a LONG
>> IDL> READU, iunit, n, m ;Read n and m
>> IDL>
>> IDL> i = LONARR(n, n, n) ;Create i array
>> IDL> z = FLTARR(m, m) ;Create z array
>> IDL> b = BYTARR(m, m) ;Create b array
>> IDL> READU, iunit, i, z, b ;Read i, z, and b
>> IDL>
>> IDL> FREE_LUN, iunit ;Close output file
>> IDL>
>> IDL> HELP, n, m, i, z, b ;Print variable info
>> IDL> PRINT, z[0:3,0:3] ;Print part of z
>> % OPENR: Error opening file. Unit: 100, File: C:\Users\fadaei\IDLWorkspace80\DEM.dat
>> The system cannot find the file specified.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> % READU: Variable is undefined: IUNIT.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> % Array dimensions must be greater than 0.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> % Array dimensions must be greater than 0.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> % Array dimensions must be greater than 0.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> % READU: Variable is undefined: IUNIT.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> % FREE_LUN: Variable is undefined: IUNIT.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> N INT = 0
>> M INT = 0
>> I UNDEFINED = <Undefined>
>> Z UNDEFINED = <Undefined>
>> B UNDEFINED = <Undefined>
>> % Variable is undefined: Z.
>> % Error occurred at: $MAIN$
>> % Execution halted at: $MAIN$
>> best, Hadi
>
> You may want to read the error messages. Start with the first one:
>
> % OPENR: Error opening file. Unit: 100, File: C:\Users\fadaei\IDLWorkspace80\DEM.dat
> The system cannot find the file specified.
>
> Is the file you are trying to read actually called C:\Users\fadaei\IDLWorkspace80\DEM.dat?

Dear Mats
yes thats right.exactly
Best Hadi
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDLnetURL Object Not Loading
Next Topic: help with imdisp

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 22:59:37 PDT 2025

Total time taken to generate the page: 0.16176 seconds