Was a file opened with /Swap_if_little_endian ? [message #82610] |
Thu, 03 January 2013 19:47 |
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
|
|
|