[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: point_lun
Hallo Reimar!
since I was looking at a similar issue yesterday night, I came across
some
statements about this in the online help. Look for "reading
files:Windows platform"
in the help index. It basically confirms what Craig said.
If nothing else helps and you *really* need to read these ASCII files
platform-
independently, you'll probably have to resort to reading it as binary
unformatted
into your own buffer, filter all CR's (13B) in case there are any, and
break the
lines at the line feeds (10B). This still leaves out the Mac World,
where they use only CR as far as I know...
Viele Gruesse,
Martin
"R.Bauer" wrote:
>
> Hi,
>
> I have recognized today point_lun makes differences between files
> written on UNIX or DOS
> for following idl version.
>
> ** Structure !VERSION, 5 tags, length=40:
> ARCH STRING 'x86'
> OS STRING 'Win32'
> OS_FAMILY STRING 'Windows'
> RELEASE STRING '5.3'
> BUILD_DATE STRING 'Nov 11 1999'
>
> My very old aix machine did not make a difference if the file is
> written for DOS or for UNIX.
>
> I have attached 2 example files and the testroutine.
>
> The result of the test for windows is:
>
> IDL> error_pointlun,'test.dos'
> 88 7777 AA xa xa
> pointer is: 36
> value: 11111.1
> new position: 66
> last position: 36
> value: 11111.1
>
> IDL> error_pointlun,'test.unix'
> 88 7777 AA xa xa
> pointer is: 31
> value: 11111.1
> new position: 61
> % READF: Input conversion error. Unit: 102, File: test.unix
> % Execution halted at: ERROR_POINTLUN 24 error_pointlun.pro
> % $MAIN$
>
> On some data files I recognized a byte shift to right.
>
> R.Bauer
>
> ------------------------------------------------------------------------
> 88 7777
> AA xa xa
> 11111.11 11.99 444.11
> 22222.22 21.99 555.11
> 33333.33 331.99 666.12
>
> ------------------------------------------------------------------------
> 88 7777
> AA xa xa
> 11111.11 11.99 444.11
> 22222.22 21.99 555.11
> 33333.33 331.99 666.12
>
> ------------------------------------------------------------------------
> PRO error_pointlun,file
>
> OPENR, IUN, file, /GET_LUN
>
> POINT_LUN, IUN, 0
>
> s=STRARR(2)
> READF,iun,s
> PRINT,s
>
> POINT_LUN,-iun,bpos
> PRINT,'pointer is:',bpos
>
> s=FLTARR(1)
> READF,iun,s
> PRINT,'value:',s
>
> POINT_LUN,-iun,npos
> PRINT,'new position:',npos
>
> s=FLTARR(1)
> POINT_LUN,iun,bpos
> READF,iun,s
> PRINT,'last position:',bpos
> PRINT,'value:',s
>
> FREE_LUN,iun
>
> END
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[