📄 topen.3f
字号:
.\" SCCSID: @(#)topen.3f 8.1 9/11/90.TH topen 3f VAX "" Unsupported.SH Nametopen, tclose, tread, twrite, trewin, tskipf, tstate \- f77 tape I/O.SH Syntax.B integer function topen (tlu, devnam, label).br.B integertlu.br.B character*(*)devnam.br.B logicallabel.sp 1.B integer function tclose(tlu).br.B integertlu.sp 1.B integer function tread(tlu, buffer).br.B integertlu.br.B character*(*)buffer.sp 1.B integer function twrite(tlu, buffer).br.B integertlu.br.B character*(*)buffer.sp 1.B integer function trewin(tlu).br.B integertlu.sp 1.B integer function tskipf(tlu, nfiles, nrecs).br.B integertlu, nfiles, nrecs.sp 1.B integer function tstate(tlu, fileno, recno, errf, eoff, eotf, tcsr).br.B integertlu, fileno, recno, tcsr.br.B logicalerrf, eoff, eotf.SH Description.NXR "topen subroutine (FORTRAN)".NXR "tclose subroutine (FORTRAN)".NXR "tread subroutine (FORTRAN)".NXR "twrite subroutine (FORTRAN)".NXR "trewind subroutine (FORTRAN)".NXR "tskipf subroutine (FORTRAN)".NXR "tstate subroutine (FORTRAN)".NXR "f77 compiler" "magnetic tape devices and"These functions provide a simple interface between f77 and magnetictape devices.A ``tape logical unit,''.IR tlu ,is ``topen''ed in much the same way as a normal f77 logical unitis ``open''ed.All other operations are performed via the.IR tlu .The.I tluhas no relationship at all to any normal f77 logical unit..PPIt should be noted that these functions return integers andshould be declared in the user program before using them. Thedefault function return value for the f77 compiler is float.The failure to declare these functions will produce improperresults..PPThe.PN topenfunctionassociates a device name with a.IR tlu .The.I tlumust be in the range 0 to 3.The logical argument.I labelshould indicate whether the tape includes a tape label.This is used by.PN trewinbelow.The.PN topenfunctiondoes not move the tape.The normal returned value is 0.If the value of the function is negative, an error has occurred. See .MS perror 3ffor details..PPThe.PN tclosefunction closes the tape device channel and removes its association with.IR tlu .The normal returned value is 0.A negative value indicates an error..PPThe.PN treadfunction reads the next physical record from tape to.IR buffer .The.I buffermust be of type.BR character .The size of.I buffershould be large enough to hold the largest physical record to be read.The actual number of bytes read will be returned as the value of thefunction.If the value is 0, the end-of-file has been detected.A negative value indicates an error..PPThe.PN twritefunction writes a physical record to tape from.IR buffer .The physical record length will be the size of.IR buffer .The.I buffer.B mustbe of type.BR character .The number of bytes written will be returned.A value of 0 or negative indicates an error..PPThe.PN trewinfunctionrewinds the tape associated with.I tluto the beginning of the first data file.If the tape is a labeled tapethen the label is skipped over after rewinding.For further information, see.PN topenabove.The normal returned value is 0.A negative value indicates an error..PPThe.PN tskipffunction allows the user to skip over files and/or records.First,.I nfilesend-of-file marks are skipped. If the current file is atEOF, this counts as 1 file to skip.(Note: This is the way to reset the EOF status for a.IR tlu .)Next,.I nrecsphysical records are skipped over.The normal returned value is 0.A negative value indicates an error..PPFinally, the.PN tstatefunctionallows the user to determine the logical state of the tape I/O channeland to see the tape drive control status register.The values of.I filenoand.I recnowill be returned and indicate the current file and record number.The logical values.IR errf ,.IR eoff ,and.I eotfindicate an error has occurred, the current file is at EOF,or the tape has reached logical end-of-tape.End-of-tape (EOT) is indicated by an empty file, oftenreferred to as a double EOF mark.It is not allowed to read past EOT although it is allowed to write.The value of.I tcsrwill reflect the tape drive control status register.For further details, see .MS tu 4 ..SH Files.ie \nM /usr/ucb/lib/libU77.a.el /usr/lib/libU77.a.SH See Alsofseek(3f), perror(3f), tu(4)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -