- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using Xcode 3.1 to compile a Fortran program that must read an old unformatted (binary) data file which was created on either a VAX or an SGI machine, or maybe a PC, but I am not certain. I know that the code was designed to read the file, so the failure of the code to do so is likely related to endian-ness and so I took the easy way first and tried using the -convert compiler option. Not all of them work. In particular, -convert big-endian should be -convert big_endian (underscore instead of dash). The same is true of little-endian. Also, trying to explicitly enter the option under getInfo>build for each file doesn't seem to work. Maybe this isn't the problem. In all attempts when the option is accepted, I am getting a run-time error #39 but I do not know where a list of run-time errors is to be found. I suppose I will need to resort to command-line compilation to get the options to work but I thought I should make users aware of this Xcode plugin problem with endian-ness options.
Any comments, advice, answers?
UPDATE:
Upon further investigation I see that compiler options of this sort can be placed within the code and so that is a workaround. As for the read error, the file is immediately seen as EOF. A hexdump of the file shows possible record boundary fields. The first contains an ETX so I will need to work around that. I now suspect VMS sequential variable length unformatted records. -KEP
UPDATE#2:
So, I have found that the records are consistent with the following open options:
form = 'UNFORMATTED',convert = 'FDX',recordtype = 'STREAM_CRLF'
To read the file I also need to read the ETX NUL at the start of each record as a pair of bytes.
But now the kicker: it seems that 'STREAM_CRLF' is behaving as just 'STREAM_LF'. Whenever a LF is encountered, the read generates and error that it is requiring too much data. The LF is not preceded by a CR. This is very annoying and means that I will need to just try recordtype='STREAM' and read yet another pair of bytes. I'll compare them with CR,LF to be sure they occur as expected. Luckily I have a code that was designed to read the file as it was on some old VAX.
----------------------------------------------
I suppose I've solved my own problem, but uncovered some possible bugs or missing features in the process.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which compiler version are you using? I know we had some issues with the STREAM* record types in earlier versions.
You might also consider FORM='BINARY' or use the Fortran 2003 ACCESS='STREAM'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry about the delayed reply ... having solved the problem I am on to something else.
To answer your question, I am using 10.1.017 because earlier versions would not work (for me) with Xcode 3.1.
- KEP

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page