rotex__system Module

Contains the definitions of stdout, stdin, stderr, and procedures to interact with the program/system such as producing warnings and stopping the execution of the code while producing error messages



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: OS_ALL = -1
integer, public, parameter :: OS_UNKNOWN = 0
integer, public, parameter :: OS_LINUX = 1
integer, public, parameter :: OS_MACOS = 2
integer, public, parameter :: OS_WINDOWS = 3
integer, public, parameter :: OS_CYGWIN = 4
integer, public, parameter :: OS_SOLARIS = 5
integer, public, parameter :: OS_FREEBSD = 6
integer, public, parameter :: OS_OPENBSD = 7
logical, public :: OS_is_windows

Is the current operating system Windows ?

integer, public, parameter :: STDIN = input_unit

The file unit associated with standard input

integer, public, parameter :: STDOUT = output_unit

The file unit associated with standard output

integer, public, parameter :: STDERR = error_unit

The file unit associated with standard error

integer, public, parameter :: IOSTAT_OK = 0

The expected iostat result from a successful call to read()

integer, public :: shell_ok

The expected return value for the current environment and shell. Used in system calls.

character(len=5), public, parameter :: PROGNAME = "ROTEX"

The program name

character(len=1), public :: DIRECTORY_SEPARATOR

The OS-dependent directory separator


Interfaces

public interface die

  • private pure subroutine die_1(message)

    Stop program execution with a message

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in), optional :: message

public interface warn

  • private subroutine warn_1(message)

    Print a warning message, but don't stop the program's execution

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: message

Functions

public pure function OS_NAME(os)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: os

Return Value character(len=:), allocatable


Subroutines

public subroutine error(message)

Print error messages to the screen without the WARNING prompt. This will typically precede a call to DIE

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message

public subroutine determine_system_properties()

Detects the type of the operating system. As far as system calls and directory structure go, this basically resolved to Windows or not Windows.

Arguments

None

public subroutine mkdir(directory)

Makes the directory "directory" and checks that it exists and is writeable

Arguments

Type IntentOptional Attributes Name
character(len=*) :: directory