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

Home » Public Forums » archive » Was a file opened with /Swap_if_little_endian ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Was a file opened with /Swap_if_little_endian ? [message #82610] Thu, 03 January 2013 19:47
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
If I open a file with the /swap_if_little_endian keyword

IDL> openr,1,'testpsf.fits',/swap_if_little

then I can use help,/file to determine if bytes will be automatically swapped. On my little endian Macbook the answer is yes.

IDL> help,/file
Unit Attributes Name
1 Read, Swap Endian testpsf.fits

But is there any way to get this information programmatically? The likely suspects FSTAT() and FILE_INFO() don't seem to give this information. So my only solution right now is to capture the output of "HELP,/FILES" and parse it.

(Some background: I want my FITS reader to be able to accept a unit number rather than a file name. But then I need to know whether the unit was previously opened for byte swapping on the fly, or whether I need to manually do the byte swapping.) Thanks, --Wayne
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Using device fonts in object graphics ?
Next Topic: Re: Was a file opened with /Swap_if_little_endian ?

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

Current Time: Wed Oct 08 18:41:57 PDT 2025

Total time taken to generate the page: 0.00433 seconds