- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am experimenting with the endian conversion
feature in the Intel Fortran compiler V7.0.
If I set the F_UFMTENDIAN environmental variable
from the shell to convert unit 10 (say), and then
run a short program to write a few values to a file
unformatted, I can see that the bytes are swapped.
I am trying to get the same effect, but entirely with
a program. I have a small C wrapper routine which
I have used in the past to call C's getenv() routine.
I tried doing a getenv() call just before the open
to the file I want to convert, but the file's contents
are not byte swapped.
Is this possible, or is the F_UFMTENDIAN envar
only looked at once when my program starts up?
John Faricelli
feature in the Intel Fortran compiler V7.0.
If I set the F_UFMTENDIAN environmental variable
from the shell to convert unit 10 (say), and then
run a short program to write a few values to a file
unformatted, I can see that the bytes are swapped.
I am trying to get the same effect, but entirely with
a program. I have a small C wrapper routine which
I have used in the past to call C's getenv() routine.
I tried doing a getenv() call just before the open
to the file I want to convert, but the file's contents
are not byte swapped.
Is this possible, or is the F_UFMTENDIAN envar
only looked at once when my program starts up?
John Faricelli
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you really using setenv and not getenv?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ooops.
I meant to say that I used a wrapper to C's
*putenv()* function. I don't think IFC's compatibility
library has a putenv() wrapper (most Unix's don't).
I did a putenv() call followed by a getenv() call,
and the F_UFMTENDIAN enviroment variable was set
to "10", the unit I wanted to convert.
Would a code example help?
John
I meant to say that I used a wrapper to C's
*putenv()* function. I don't think IFC's compatibility
library has a putenv() wrapper (most Unix's don't).
I did a putenv() call followed by a getenv() call,
and the F_UFMTENDIAN enviroment variable was set
to "10", the unit I wanted to convert.
Would a code example help?
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I looked this up in our support database, and another user recently reported the same thing (case Q166051). Currently, the run-time library looks at the environment variable once only - either when the Fortran main program starts up, or if the main isn't Fortran, on the first I/O.
A change is being implemented that would require you to use SETENVQQ to define the environment variable rather than "putenv", but an update with this change is not yet available. I suggest periodically checking the release notes for new releases available through Premier Support to see when this change is available.
Steve
A change is being implemented that would require you to use SETENVQQ to define the environment variable rather than "putenv", but an update with this change is not yet available. I suggest periodically checking the release notes for new releases available through Premier Support to see when this change is available.
Steve

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