Unit Testing Frameworks for Fortran

The isatty() function is an operating system call, not a C library call. It is a POSIX function, so the use should be portable to any posix-compliant OS. Of course, the API is defined in C, as all POSIX functions are defined. The two choices are to try to call the OS function directly from fortran, or to write a wrapper in C and then call that from fortran. In this case, there are some error codes that are set, and those are easiest to reference from C, so maybe the wrapper approach is indicated. Also, the argument to the function is a file descriptor, so there is the issue of associating a fortran unit with a C file descriptor.

edit: I also noticed the previous discussion topic. Should INQUIRE have an ISATTY parameter?

1 Like