readu/writeu oddity in xdr files [message #7180] |
Mon, 07 October 1996 00:00  |
Kile_Baker
Messages: 5 Registered: March 1994
|
Junior Member |
|
|
I'm not sure my original post ever got out to the network, since I've
seen no followup from anybody. So I will repost it. If you've seen
this already, my apologies.
I was sent the following program to read an XDR file.
function read_file,filename
openr,unit,/get_lun,filename,/xdr
time=''
filter=''
m=0
n=0
writeu,unit,time
writeu,unit,filter
writeu,unit,m,n
image=fltarr(m,n)
writeu,unit,image
close,unit
return,image
end
OK, the file was opened for READING, but from then on the program used
WRITEU statements, not READU. However, the program produced no errors,
and the really weird thing is that it actually does read the data from the
file and returns the desired image to the calling program.
This was done on an HP UNIX system. Does anyone know if the same
thing would happen on other systems? Is there some reason why it
is supposed to work this way?
By the way, this only works with files that have been opened with the
XDR keyword.
--
Kile Baker (kile_baker@jhuapl.edu) | All opinions are my own and
Johns Hopkins Applied Phys. Lab | not those of the JHU/APL
|
|
|
Re: readu/writeu oddity in xdr files [message #7237 is a reply to message #7180] |
Mon, 14 October 1996 00:00  |
Tim Patterson
Messages: 65 Registered: October 1995
|
Member |
|
|
David Fanning wrote:
>
> You have mistakenly gotten ahold of a beta version of IDL 5.0.
> This completely unpublicized feature will completely revolutionize
> IDL programming. No more do you have to actually type what you
> want IDL to do. In this version, IDL can *read your mind* and do
> what you *thought* you were typing!
I've heard PV Wave 7.0 goes one better though. Instead
of reading your mind and doing what you thought you were
doing, it actually reads your boss's mind and does what
you _really_ should have been doing!
Tim
|
|
|