Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference Intel® Fortran Libraries Reference

h.eng.cam.ac.uk
from h.eng.cam.ac.uk More from this publisher
12.07.2015 Views

2 Intel Fortran Libraries Referencemode(Input) Character*(*). Modes of accessibility to check for. Must be a character string of length oneor greater containing only the characters "r", "w", "x", or "" (a blank). These characters areinterpreted as follows.Characterrwx(blank)MeaningTests for read permissionTests for write permissionTests for execute permission. On Windows* systems, theextension of name must be .COM, .EXE, .BAT, .CMD, .PL, .KSH,or .CSH.Tests for existenceThe characters within mode can appear in any order or combination. For example, wrx and r arelegal forms of mode and represent the same set of inquiries.Results:The value of the result is INTEGER(4). It is zero if all inquiries specified by mode are true. Ifeither argument is invalid, or if the file cannot be accessed in all of the modes specified, one of thefollowing error codes is returned:• EACCES: Access denied; the file’s permission setting does not allow the specified access.• EINVAL: The mode argument is invalid.• ENOENT: File or path not found.For a list of error codes, see “IERRNO”.The name argument can contain either forward or backward slashes for path separators.On Windows* systems, all files are readable. A test for read permission always returns 0.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS LIBSee Also: “GETFILEINFOQQ”, the INQUIRE statement in the Language ReferenceExampleUSE IFPORT! checks for read and write permission on the file "DATAFILE.TXT"J = ACCESS ("DATAFILE.TXT", "rw")PRINT *, J! checks whether "DATAFILE.TXT" is executable. It is not, since! it does not end in .COM, .EXE, .BAT, or .CMD2-4

Descriptions of the Library Routines 2J = ACCESS ("DATAFILE.TXT","x")PRINT *, JALARMPortability Function: Causes a subroutine to begin execution after a specified amount of time haselapsed.Module: USE IFPORTSyntaxresult = ALARM (time, proc)time(Input) Integer. Specifies the time delay, in seconds, between the call to ALARM and the timewhen proc is to begin execution. If time is 0, the alarm is turned off and no routine is called.proc(Input) Name of the procedure to call. The procedure takes no arguments and must be declaredEXTERNAL.Results:The return value is INTEGER(4). It is zero if no alarm is pending. If an alarm is pending (hasalready been set by a previous call to ALARM), it returns the number of seconds remaining untilthe previously set alarm is to go off, rounded up to the nearest second.After ALARM is called and the timer starts, the calling program continues for time seconds. Thecalling program then suspends and calls proc, which runs in another thread. When proc finishes,the alarm thread terminates, the original thread resumes, and the calling program resets the alarm.Once the alarm goes off, it is disabled until set again.If proc performs I/O or otherwise uses the Fortran library, you need to compile it with one of themultithread libraries. For more information on multithreading, see "Creating MultithreadApplications" in your user’s guide.The thread that proc runs in has a higher priority than any other thread in the process. All otherthreads are essentially suspended until proc terminates, or is blocked on some other event, such asI/O.No alarms can occur after the main process ends. If the main program finishes or any threadexecutes an EXIT call, than any pending alarm is deactivated before it has a chance to run.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS LIBSee Also: “RUNQQ”2-5

2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>mode(Input) Character*(*). Modes of accessibility to check for. Must be a character string of length oneor greater containing only the characters "r", "w", "x", or "" (a blank). These characters areinterpreted as follows.Characterrwx(blank)MeaningTests for read permissionTests for write permissionTests for execute permission. On Windows* systems, theextension of name must be .COM, .EXE, .BAT, .CMD, .PL, .KSH,or .CSH.Tests for existenceThe characters within mode can appear in any order or combination. For example, wrx and r arelegal forms of mode and represent the same set of inquiries.Results:The value of the result is INTEGER(4). It is zero if all inquiries specified by mode are true. Ifeither argument is invalid, or if the file cannot be accessed in all of the modes specified, one of thefollowing error codes is returned:• EACCES: Access denied; the file’s permission setting does not allow the specified access.• EINVAL: The mode argument is invalid.• ENOENT: File or path not found.For a list of error codes, see “IERRNO”.The name argument can contain either forward or backward slashes for path separators.On Windows* systems, all files are readable. A test for read permission always returns 0.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS LIBSee Also: “GETFILEINFOQQ”, the INQUIRE statement in the Language <strong>Reference</strong>ExampleUSE IFPORT! checks for read and write permission on the file "DATAFILE.TXT"J = ACCESS ("DATAFILE.TXT", "rw")PRINT *, J! checks whether "DATAFILE.TXT" is executable. It is not, since! it does not end in .COM, .EXE, .BAT, or .CMD2-4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!