⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fdosfile.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 5 页
字号:
.note FIXED
.*=========
.ix 'RECORDTYPE' 'FIXED'
.ix 'FIXED record type'
indicates that the file contains no extra information that determines
the record structure.
If the file is a direct access file, the value specified by the
.kw RECL=
specifier determines the size of each record in the file.
.np
By default, the &cmpname run-time system uses
.kw FIXED
format files to implement
.kw UNFORMATTED
records in the
.us direct
access mode.
.np
If you specify
.kw FIXED
with an unformatted sequential file, the size of the records is
determined by the items in the input/output list.
.endnote
.*
.section Record Size
.*
.np
.ix 'record size'
When access is
.us direct,
the record length must be specified in the
.kw RECL=
specifier of the FORTRAN
.kw OPEN
statement.
.code begin
OPEN( UNIT=1, FILE='TEST.DAT', ACCESS='DIRECT', RECL=size, ... )
.code end
.np
As an extension to the FORTRAN 77 language standard,
the record length may also be specified when the access is
.us sequential.
This should be done whenever access is "sequential" and the maximum
record length is greater than the default.
.code begin
OPEN( UNIT=1, FILE='TEST.DAT', ACCESS='SEQUENTIAL', RECL=size, ... )
.code end
.np
The record length specified by
.us size
should not include record separators such as CR and LF, nor should it
include record length descriptors when sequentially accessing a file
containing unformatted records.
However, for all files, records longer than the size specified will be
truncated.
The default record size is 1024.
The maximum record size is 65535 for the 16-bit run-time system.
Since record buffers are allocated in the dynamic storage region, the
size will be restricted to the amount of dynamic storage available.
.*
.section *refid=fdospfa Print File Attributes
.*
.np
.ix 'print file'
When the first character of each record written to a file will contain
an ASA (American Standards Association) carriage control character,
the
.kw CARRIAGECONTROL=
specifier of the FORTRAN
.kw OPEN
statement should be used.
This specifier is an extension to the FORTRAN 77 language standard.
The ASA character is used for vertical spacing control.
The valid characters and their interpretation are:
.begnote
.note "1"
Advance to Top of Page
.note "+"
Advance Zero Lines (overprint)
.note " "
Advance 1 Line
.note "0"
Advance 2 Lines
.note "-"
Advance 3 Lines
.endnote
.np
If
.mono CARRIAGECONTROL='YES'
is specified then the &cmpname run-time system will automatically
allocate an extra character at the beginning of a record for the
vertical spacing control.
.np
Upon transmitting a record to a file which has the "carriage"
attribute, the &cmpname run-time system will substitute the
appropriate ASCII carriage control characters as follows.
.begnote
.note "1"
Substitute a FF (form feed) for the "1".
.note "+"
Append only a CR (carriage return ) to the previous record.
.note "~b"
Throw away the blank character.
.note "0"
Substitute CR (carriage return) and LF (line feed) for the "0".
.note "-"
Substitute two pairs of CR and LF for the "-".
.np
Any other character in this position will be treated as if a blank
character had been found (i.e., it will be discarded).
.endnote
.np
If the "carriage" attribute is not specified for a file then records
will be written to the file without placing any interpretation on the
first character position of the record.
.*
.section Input/Output Buffer Size
.*
.np
.ix 'buffer size'
The
.kw BLOCKSIZE=
specifier is optional.
However if you would like to change the default buffer size of
16K for 32-bit applications and
4K for 16-bit applications,
you must specify the buffer size in the
.kw BLOCKSIZE=
specifier of the
.kw OPEN
statement.
.code begin
OPEN( UNIT=1, FILE='TEST.DAT', BLOCKSIZE=1024, ... )
.code end
.*
.section File Sharing
.*
.np
.ix 'file sharing'
On systems that support multi-tasking or networking, it is possible for
for a file to be accessed simultaneously by more that one process.
There are two specifiers in the
.KW OPEN
statement that can be used to control the way in which files are shared
between processes.
.np
The
.kw ACTION=
specifier indicates the way in which the file is initially accessed.
That is, the way in which the first process to open the file accesses the
file.
The values allowed for the
.kw ACTION=
specifier are the following.
.begnote
.note 'READ'
the file is opened for read-only access
.note 'WRITE'
the file is opened for write-only access
.note 'READWRITE'
the file is opened for both read and write access
.endnote
.np
The
.kw SHARE=
specifier can be used to indicate the manner in which subsequent processes
are allowed to access the file while the file is open.
The values allowed for the
.kw SHARE=
specifier are the following.
.begnote
.note 'COMPAT'
.ix 'COMPAT'
no other process may open the file
.note 'DENYRW'
.ix 'DENYRW'
other processes are denied read and write access
.note 'DENYWR'
.ix 'DENYWR'
other process are denied write access (allowed read-only access)
.note 'DENYRD'
.ix 'DENYRD'
other process are denied read access (allowed write-only access)
.note 'DENYNONE'
.ix 'DENYNONE'
other processes are allowed read and write access
.endnote
.np
Let us consider the following scenario.
Suppose you want several processes to read a file and prevent any process
that is reading the file from changing its contents.
We first must establish the method of access for the first process that
opens the file.
In this case, we want read-only access so the
.mono ACTION='READ'
specifier must be used.
Next, we must establish the method of access for subsequent processes.
In our example, we do not want any process to make changes to the file.
Therefore, we use the
.mono SHARE='DENYWR'
specifier.
The file would be opened using the following
.kw OPEN
statement.
.code begin
OPEN( UNIT=1, FILE='TEST.DAT', ACTION='READ', SHARE='DENYWR', ... )
.code end
.endlevel
.*
.section File Names in the FAT File System
.*
.np
.ix 'FAT file system'
.ix 'HPFS file system'
The FAT file system is supported by DOS and OS/2.
OS/2 also supports the High Performance File System (HPFS) which will
be discussed in a later section.
.ix 'file designation'
File naming conventions are used to form file designations in a given
file system.
The file designation for a FAT file system has the following form.
.millust begin
[d:][path]filename[.ext]
.millust end
.begnote
.note []
The square brackets denote items which are optional.
.ix 'drive name'
.note d:
is the
.us drive name.
If omitted, the default drive is assumed.
.np
Examples of drive names are: :FNAME.&dr1.:eFNAME., :FNAME.&dr2.:eFNAME.,
:FNAME.&dr3.:eFNAME., and :FNAME.&dr4.:eFNAME..
.ix 'path'
.note path
is called a "path" specification.
The path may be used to refer to files that are stored in
sub-directories of the disk.
The complete file specification (including drive, path and file name)
cannot exceed 143 characters.
.np
Some examples of path specifications are:
.millust begin
&pc.plot&pc.
&pc.bench&pc.tools&pc.
&pc.fortran&pc.pgms&pc.
.millust end
.pc
Your operating system manuals can tell you more about directories:
how to create them, how to store files in them, how to specify a path,
etc.
.ix 'filename'
.note filename
is the main part of the file's name.
The filename can contain up to 8 characters.
If more than 8 characters are used, only the first 8 are meaningful.
For example, "COUNTRIES" and "COUNTRIE" are treated as the same name
for a file.
.ix 'extension'
.note ext
is an optional
.us extension
consisting of 1 to 3 characters (e.g., DOC).
If an extension is specified, it is separated from the filename by a
period.
Extensions are normally used to indicate the type of information
stored in the file.
For example, a file extension of :FNAME.for:eFNAME. is a common convention
for FORTRAN programs.
.endnote
.remark
.ix 'file name' 'case sensitivity'
The file specification is case insensitive in that upper and lower
case letters can be used interchangeably.
.eremark
.*
.beglevel
.*
.section Special DOS Device Names
.*
.np
.ix 'device names'
Certain file names are reserved for devices.
These special device names are:
.ix 'CON'
.ix 'AUX'
.ix 'COM1'
.ix 'COM2'
.ix 'PRN'
.ix 'LPT1'
.ix 'LPT2'
.ix 'LPT3'
.ix 'NUL'
.ix 'device' 'CON'
.ix 'device' 'AUX'
.ix 'device' 'COM1'
.ix 'device' 'COM2'
.ix 'device' 'PRN'
.ix 'device' 'LPT1'
.ix 'device' 'LPT2'
.ix 'device' 'LPT3'
.ix 'device' 'NUL'
.millust begin
CON   the console (or terminal)
AUX   the serial port
COM1  another name for the serial port
COM2  a second serial port
PRN   the parallel printer
LPT1  another name for the printer
LPT2  a second parallel printer
LPT3  a third parallel printer
NUL   nonexistent device
.millust end
.pc
When using one of these special device names, no other part of the
file designation should be specified.
A common mistake is to attempt to create a disk file such as
.fi PRN.DAT
and attempt to write records to it.
If you do not have a parallel printer attached to your PC, there may
be a long delay before the output operation times out.
.*
.section Examples of FAT File Specifications
.*
.np
The following are some examples of valid file specifications.
.autonote
.note
The following file designation refers to a file in the current
directory of the default disk.
.code begin
OPEN( UNIT=1, FILE='DATA.FIL', ... )
.code end
.note
The following file designation refers to a print file in the current
directory of drive :FNAME.&dr3.:eFNAME..
ASA carriage control characters will be converted to the appropriate
ASCII control codes.
.code begin
OPEN( UNIT=2, FILE=':FNAME.&dr3.report&lst.:eFNAME.',
      CARRIAGECONTROL='YES', ... )
.code end
.note
The file specification below indicates that the file is to have
fixed format records of length 80.
.code begin
OPEN( UNIT=3, FILE=':FNAME.final.tst:eFNAME.',
      RECL=80, RECORDTYPE='FIXED', ... )
.code end
.note
The file specification below indicates that the file is to have
variable format records of maximum length 145.
.code begin
OPEN( UNIT=4, FILE=':FNAME.term.rpt:eFNAME.',
      RECL=145, RECORDTYPE='VARIABLE', ... )
.code end
.note
The file designation below indicates that the file resides in the
:FNAME.records:eFNAME. directory of drive :FNAME.&dr2.:eFNAME..
.code begin
OPEN( UNIT=5, FILE=':FNAME.&dr2.&pc.records&pc.customers.dat:eFNAME.', ... )
.code end
.pc
Note that the trailing "S" in the file name will be ignored.
Thus the following designation is equivalent.
.code begin
OPEN( UNIT=5, FILE=':FNAME.&dr2.&pc.records&pc.customer.dat:eFNAME.', ... )
.code end
.note
The file designation below refers to the second serial port.
.code begin
OPEN( UNIT=6, FILE=':FNAME.com2:eFNAME.', ... )
.code end
.note
The file designation below refers to a second parallel printer.
.code begin
OPEN( UNIT=7, FILE=':FNAME.lpt2:eFNAME.', ... )
.code end
.endnote
.*
.endlevel
.*
.section File Names in the High Performance File System
.*
.np
.ix 'HPFS file system'
OS/2, in addition to supporting the FAT file system, also supports the
High Performance File System (HPFS).
The rules for forming file names in the High Performance File System
are different from those used to form file names in the FAT file
system.
In HPFS, file names and directory names can be up to 254 characters in
length.
However, the complete path (including drive, directories and file
name) cannot exceed 259 characters.
The period is a valid file name character and can appear in a file
name or directory name as many times as required; HPFS file names do

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -