system to determine OS 
Author Message
 system to determine OS

I am looking for a function call to determine what
OS platform a fortran program is runninng on that will
work from MacOS X, Windows, and linux, and not throw
an error on the other platforms.

Something like call system('something') but with the
ability to capture the result in a variable. As
(ignore variable types, etc.):

      os=ostype()
      if(os.eq.mac) ...
      if(os.eq.windows) ...
      if(os.eq.linux) ...

Thanks!



Sun, 11 Sep 2011 23:45:15 GMT  
 system to determine OS
Quote:

> I am looking for a function call to determine what
> OS platform a fortran program is runninng on that will
> work from MacOS X, Windows, and linux, and not throw
> an error on the other platforms.

...
Since those executables would had to have been built for the specific OS
anyway, seems logical to build it into the executable as a parameter
(part of a conditional compile, maybe?)...

--



Mon, 12 Sep 2011 09:42:50 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. system function to determine OS

2. os.popen() vs os.system()

3. Using os.system and os.popen from pythonwin under Windows NT

4. os.system() or os.execv() w/stdout redirect and PID tracking

5. os.system/os.popen ultrasparc

6. Blocking ctrl-c to os.popen() or os.system()

7. Determining File Versions OS X

8. Determine OS at runtime

9. Determining how many days between dates (os/2 warp v3)

10. Determining how many days between dates (os/2 warp v3

11. Determine the drive OS/2 resides on?

 

 
Powered by phpBB® Forum Software