# E.1 Portability Routines (WNT, W9*)

To use a portability routine, add the following statement to the program unit containing the routine:

  USE DFPORT

Table E-1 summarizes portability routines. Many of these routines are also available as `3f` library routines on Tru64 UNIX and Linux systems.

Table E-1 Summary of Portability Routines (WNT, W9*)

Name | Description
--- | ---
Information Retrieval
CHDIR | Changes the current working directory.
FSTAT | Returns information about a logical file unit.
GETCWD | Returns the pathname of the current working directory.
GETENV | Searches the environment for a given string and returns its value if found.
GETGID | Returns the group ID of the user.
GETPID | Returns the process ID of the process.
GETLOG | Returns the user's login name.
GETUID | Returns the user ID of the user of the process.
HOSTNAM | Returns the name of the user's host.
IARGC | Returns the index of the last command-line argument.
RENAME | Renames a file.
STAT, LSTAT | Returns information about a named file.
UNLINK | Deletes the file given by path.
Process Control
ABORT | Stops execution of the current process, clears I/O buffers, and writes a string to external unit 0.
ALARM | Executes an external subroutine after waiting a specified number of seconds.
KILL | Sends a signal code to the process given by ID.
SLEEP | Suspends program execution for a specified number of seconds.
SIGNAL | Changes the action for signal.
SYSTEM | Executes a command in a separate shell.
Numeric Routines
BESJ0, BESJ1, BESJN, BESY0, BESY1, BESYN | Returns single-precision values of Bessel functions of the first and second kind of orders 1, 2, and n, respectively.
BIC, BIS, BIT | Perform bit level clear, set, and test for integers.
DBESJ0, DBESJ1, DBESJN, DBESY0, DBESY1, DBESYN | Returns double-precision values of Bessel functions of the first and second kind of orders 1, 2, and n, respectively.
DRAND, DRANDM | Returns random values in the range 0 through 1.0.
IRAND, IRANDM | Returns a positive integer in the range 0 through 2**31-1 or 2**15-1 if called without an argument.
LONG | Converts an INTEGER(2) variable to an INTEGER(4) type.
RAN | Returns random values in the range 0 through 1.0.
RAND, RANDOM | Returns random values in the range 0 through 1.0.
SHORT | Converts an INTEGER(4) variable to an INTEGER(2) type.
SRAND | Seeds the random number generator used with IRAND and RAND.
Input and Output Routines
ACCESS | Checks a file for accessibility according to mode.
CHMOD | Changes file attributes.
FGETC | Reads a character from an external unit.
FLUSH | Flushes the buffer for an external unit to its associated file.
FPUTC | Writes a character to an external unit.
FSEEK | Repositions a file on an external unit.
FTELL | Returns the offset, in bytes, from the beginning of the file.
GETC | Reads a character from unit 5.
PUTC | Writes a character to unit 6.
Date and Time Routines
CLOCK | Returns current time in "hh:mm:ss" format using a 24-hour clock.
CTIME | Converts a system time to a 24-character ASCII string.
DATE | Returns a string representation of the current date.
DTIME 1 | Returns CPU time since later of (1) start of program, or (2) most recent call to DTIME.
ETIME 1 | Returns elapsed CPU time since the start of program execution.
FDATE | Returns the current date and time as an ASCII string.
GMTIME | Returns Greenwich Mean Time as a 9-element integer array.
IDATE | Returns date either as one 3-element array or three scalar parameters (month, day, year).
ITIME | Returns current time as a 3-element array (hour, minute, second).
JDATE | Returns current date as an 8-character string with the Julian date.
LTIME | Returns local time as a 9-element integer array.
RTC | Returns number of seconds since 00:00:00 GMT, Jan 1, 1970.
SECNDS | Returns number of seconds since midnight, less the value of its argument.
TIME | As a subroutine, returns time formatted as hh:mm:ss; as a function, returns time in seconds since 00:00:00 GMT, Jan 1, 1970.
TIMEF | Returns the number of seconds since the first time this function was called (or zero).
Error Handling Routines
GERROR | Returns the IERRNO error code as a string variable.
IERRNO | Returns the last code error.
PERROR | Returns an error message, preceded by a string, for the last error detected.
Miscellaneous Routines
LNBLNK | Returns the index of the last non-blank character in a string.
QSORT | Returns a sorted version of a one-dimensional array of a specified number of elements of a named size.
RINDEX | Returns the index of the last occurrence of a substring in a string.
1 WNT only

For more information on these routines, see the Compaq Visual Fortran online Reference.

Previous Page Next Page Table of Contents