Download Fortran Library Reference

Transcript
If the file specified by to exists, then both from and to must be the same type of file,
and must reside on the same file system. If to exists, it is removed first.
Example: rename()—Rename file trename.old to trename.new
demo% cat trename.f
INTEGER*4 rename, status
character*18 from/"trename.old"/, to/"trename.new"/
status = rename( from, to )
if ( status .ne. 0 ) stop "rename: error"
end
demo% f77 -silent trename.f
demo% ls trename*
trename.f trename.old
demo% a.out
demo% ls trename*
trename.f trename.new
demo%
See also rename(2) and perror(3F).
Note: the path names cannot be longer than MAXPATHLEN as defined in
<sys/param.h>.
secnds: Get System Time in Seconds,
Minus Argument
t = secnds( t0 )
t0
REAL
Input
Constant, variable, or array element
Return Value
REAL
Output
Number of seconds since midnight, minus t0
Example: secnds:
demo% cat sec1.f
real elapsed, t0, t1, x, y
t0 = 0.0
t1 = secnds( t0 )
y = 0.1
do i = 1, 1000
x = asin( y )
end do
elapsed = secnds( t1 )
write ( *, 1 ) elapsed
1
format ( " 1000 arcsines: ", f12.6, " sec" )
end
FORTRAN Library Routines
81