The features described in this topic are obsolete
and should not be used in new IDL code.
OPEN
The following keywords to the three OPEN procedures are obsolete.
Macintosh-Only Keywords
MACCREATOR
Use this keyword to specify a four-character scalar string identifying the Macintosh file creator code of the file being created. For example, set
to create a file with the creator code MSWD. The default creator code is MIDL.
MACTYPE
Use this keyword to specify a four-character scalar string identifying the Macintosh file type of the file being created. For example, set
to create a file of type PICT. The default file type is TEXT.
UNIX-Only Keywords
The previous keyword NOSTDIO is now obsolete. It has been renamed RAWIO to reflect the fact that stdio may or may not actually be used. All references to NOSTDIO should be changed to be RAWIO, but NOSTDIO will still be accepted as a synonym for RAWIO.
NOSTDIO
Set this keyword to disable all use of the standard UNIX I/O for the file, in favor of direct calls to the operating system. This allows direct access to devices, such as tape drives, that are difficult or impossible to use effectively through the standard I/O. Using this keyword has the following implications:
- No formatted or associated (ASSOC) I/O is allowed on the file. Only READU and WRITEU are allowed.
- Normally, attempting to read more data than is available from a file causes the unfilled space to be set to zero and an error to be issued. This does not happen with files opened with NOSTDIO. When using NOSTDIO, the programmer must check the transfer count, either via the TRANSFER_COUNT keywords to READU and WRITEU, or the FSTAT function.
- The EOF and POINT_LUN functions cannot be used with a file opened with NOSTDIO.
- Each call to READU or WRITEU maps directly to UNIX read(2) and write(2) system calls. The programmer must read the UNIX system documentation for these calls and documentation on the target device to determine if there are any special rules for I/O to that device. For example, the size of data that can be transferred to many cartridge tape drives is often forced to be a multiple of 512 bytes.
VMS-Only Keywords
BLOCK
Set this keyword to process the file using RMS block mode. In this mode, most RMS processing is bypassed and IDL reads and writes to the file in disk block units. Such files can only be accessed via unformatted I/O commands. Block mode files are treated as an uninterpreted stream of bytes in a manner similar to UNIX stream files.
For best performance, by default IDL uses RMS block mode for fixed length record files. However, when the SHARED keyword is present, IDL uses standard RMS mode. Do not specify both BLOCK and SHARED.
This keyword is ignored when used with stream files.
Note
With some controller/disk combinations, RMS does not allow transfer of an odd number of bytes.
DEFAULT
A scalar string that provides a default file specification from which missing parts of the File argument are taken. For example, to make .LOG be the default file extension when opening a new file, use the command:
This statement will open the file DATA.LOG.
EXTENDSIZE
File extension is a relatively slow operation, and it is desirable to minimize the number of times it is done. In order to avoid the unacceptable performance that would result from extending a file a single block at a time, VMS extends its size by a default number of blocks in an attempt to trade a small amount of wasted disk space for better performance. The EXTENDSIZE keyword overrides the default, and specifies the number of disk blocks by which the file should be extended. This keyword is often used in conjunction with the INITIALSIZE and TRUNCATE_ON_CLOSE keywords.
FIXED
Set this keyword to indicate that the file has fixed-length records. The Record_Length argument is required when opening new, fixed-length files.
FORTRAN
Set this keyword to use FORTRAN-style carriage control when creating a new file. The first byte of each record controls the formatting.
INITIALSIZE
The initial size of the file allocation in blocks. This keyword is often used in conjunction with the EXTENDSIZE and TRUNCATE_ON_CLOSE keywords.
KEYED
Set this keyword to indicate that the file has indexed organization. Indexed files are discussed in "VMS-Specific Information" in Chapter 8 of Application Programming.
LIST
Set this keyword to specify carriage-return carriage control when creating a new file. If no carriage-control keyword is specified, LIST is the default.
NONE
Set this keyword to specify explicit carriage control when creating a new file. When using explicit carriage control, VMS does not add any carriage control information to the file, and the user must explicitly add any desired carriage control to the data being written to the file.
Set this keyword to send the file to SYS$PRINT, the default system printer, when it is closed.
SEGMENTED
Set this keyword to indicate that the file has VMS FORTRAN-style segmented records. Segmented records are a method by which FORTRAN allows logical records to exist with record sizes that exceed the maximum possible physical record sizes supported by VMS. Segmented record files are useful primarily for passing data between FORTRAN and IDL programs.
SHARED
Set this keyword to allow other processes read and write access to the file in parallel with IDL. If SHARED is not set, read-only files are opened for read sharing and read/write files are not shared. The SHARED keyword cannot be used with STREAM files.
Warning
It is not a good idea to allow shared write access to files open in RMS block mode. In block mode, VMS cannot perform the usual record locking that prevents file corruption. It is therefore possible for multiple writers to corrupt a block mode file. This warning also applies to fixed-length record disk files, which are also processed in block mode. When using SHARED, do not specify either BLOCK or UDF_BLOCK.
STREAM
Set this keyword to open the file in stream mode using the Standard C Library (stdio).
SUBMIT
Set this keyword to submit the file to SYS$BATCH, the default system batch queue, when it is closed.
SUPERSEDE
Set this keyword to allow an existing file to be superseded by a new file of the same name, type, and version.
TRUNCATE_ON_CLOSE
Set this keyword to free any unused disk space allocated to the file when the file is closed. This keyword can be used to get rid of excess allocations caused by the EXTENDSIZE and INITIALSIZE keywords. If the SHARED keyword is set, or the file is open for read-only access, TRUNCATE_ON_CLOSE has no effect.
UDF_BLOCK
Set this keyword to create a file similar to those created with the BLOCK keyword except that new files are created with the RMS undefined record type. Files created in this way can only be accessed by IDL in block mode, and cannot be processed by many VMS utilities. Do not specify both UDF_BLOCK and SHARED.
VARIABLE
Set this keyword to indicate that the file has variable-length records. If the Record_Length argument is present, it specifies the maximum record size. Otherwise, the only limit is that imposed by RMS (32767 bytes). If no file organization is specified, variable-length records are the default.
Warning
VMS variable length records have a 2-byte record-length descriptor at the beginning of each record. Because the FSTAT function returns the length of the data file including the record descriptors, reading a file with VMS variable length records into a byte array of the size returned by FSTAT will result in an RMS EOF error.
Windows-Only Keywords
The Windows-Only keywords BINARY and NOAUTOMODE are now obsolete. Input/Output on Windows is now handled indentically to Unix, and does not require you to be concerned about the difference between "text" and "binary" modes. These keywords are still accepted for backwards compatibility, but are ignored.
BINARY
Set this keyword to treat opened files as binary files. When writing text to a binary file, CR/LF pairs are written as LF only. Note that setting the BINARY keyword alone does not ensure that a routine that writes to the file will not change the mode to text.
NOAUTOMODE
Set this keyword to prevent IDL routines such as PRINTF from automatically changing the mode from binary to text, or vice versa.