[sac-dev] bug fix: read write header

Brian Savage savage13 at dtm.ciw.edu
Mon Feb 13 06:46:55 PST 2006


All,

I have created a patch for the read header / write header bug discovered
a while back.  It effectively handles big and small endian files.

This patch determines the file's endianness and writes the appropriate
header. During a write header, this is the logic:

- Open file to be written (file must already exist)
- Read in Old Header
- Examine Version Number
- If version number between 1 and current version (6)
    - Write header
- If version number not between 1 and current version (6)
    - Swap version number
    - If version number not between 1 and current verison (6)
         Issue Error
    - If version number between 1 and current version (6)
         Write swapped header
- Close File

Based on the current CVS version, please test and get back to me.

Cheers,
Brian
savage13 at dtm.ciw.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rwhdr.patch
Type: text/x-patch
Size: 6121 bytes
Desc: not available
Url : http://www.iris.washington.edu/pipermail/sac-dev/attachments/20060213/32983d30/rwhdr.bin


More information about the sac-dev mailing list