Files [ MPE/iX Developer's Kit Reference Manual Volume I ] MPE/iX 5.0 Documentation
MPE/iX Developer's Kit Reference Manual Volume I
Files
This section provides an overview of implementation considerations that
you should understand when creating, accessing, and managing files
through the POSIX/iX library. For more information about how files are
created and managed in a POSIX.1 environment, refer to chapter 3, "Files
and Directories", in The POSIX.1 Standard - A Programmer's Guide
(36430-90003).
Additional information about MPE/iX byte-stream files is located in New
Features of MPE/iX: Using the Hierarchical File System (32650-90351).
POSIX File Types
The following table lists the five file types defined in the POSIX.1
standard as well as their equivalent implementations on MPE/iX:
Table 3-1. MPE/iX Implementations of POSIX File Types
--------------------------------------------------------------------------------------------
| | |
| POSIX File Type | MPE/iX File Type |
| | |
--------------------------------------------------------------------------------------------
| | |
| Regular file | Byte-stream file, used to refer to an MPE/iX |
| | standard ASCII disk file with a record format of |
| | byte-stream. |
| | |
--------------------------------------------------------------------------------------------
| | |
| Directory special file | Hierarchical directory, used to refer to an MPE/iX |
| | standard disk file with a file type of directory. |
| | |
--------------------------------------------------------------------------------------------
| | |
| FIFO special file | Supported on 5.0 |
| | |
--------------------------------------------------------------------------------------------
| | |
| Block device special file | Not currently implemented on MPE/iX |
| | |
--------------------------------------------------------------------------------------------
| | |
| Character device special file | Not currently implemented on MPE/iX |
| | |
--------------------------------------------------------------------------------------------
MPE/iX supports a file whose record format is byte-stream to comply with
the regular file behavior defined in the POSIX.1 standard. All files
created or opened through POSIX/iX library functions are MPE/iX
byte-stream files.
Refer to the section "Directories" for implementation details of MPE/iX
HFS directories.
Creating and Opening Files
While MPE/iX supports many file types and file record formats, only
MPE/iX byte-stream files can be created or opened using POSIX/iX library
functions. Attempts to open an existing file that is not a byte-stream
file result in an error, with errno set to EIMPL. This applies to
emulators.
The group ID (GID) of a newly created file or directory is set to the GID
of the directory (the parent directory) in which the file is created.
Creating Pipes, FIFOs, and Special Files.
Pipes and FIFOs are supported on 5.0 and later systems. Device special
files, and read-only file systems are not currently implemented through
POSIX/iX interfaces. The standard files are inherited from the parent
process, which has them opened as STDIN_FILENO, STDOUT_FILENO, and
STDERR_FILENO (defined in the header <unistd.h>.
Directory Restrictions.
A file created directly under the root directory or directly under an
MPE/iX group cannot have a file name that exceeds 16 characters in
length. Attempts to create a file whose name exceeds 16 characters in
length directly under either the root directory or an MPE/iX group result
in an error, with errno set to EIMPL.
Input/Output Considerations
The following sections describe implementation details associated with
POSIX/iX data transfer functions. For more information about POSIX.1
input and output, refer to chapter 4, "Input and Output", in The POSIX.1
Standard - A Programmer's Guide (36430-90003).
The POSIX.1 standard does not support the MPE/iX concept of a file limit.
MPE/iX provides two facilities for limiting the amount of disk space that
a user can have for files:
* file limit
* MPE/iX accounting limits on disk space
File Limits.
MPE/iX supports file limits on all objects created on the system to allow
users to control the maximum size a that file can attain. Files created
through POSIX/iX library functions have file limits. The default file
limit for a byte-stream file is two gigabytes when created through
POSIX/iX library functions. A file's file limit cannot be manipulated
through POSIX/iX functions.
Attempts to write data to a file that would result in that file's size
exceeding the file limit result in an error, with errno set to EFBIG.
The file limit of two gigabytes should rarely, if ever, be reached;
however, a user can use MPE/iX CI commands or system intrinsics to set a
file limit to a much lower value. If you open a byte-stream file whose
file limit has been set to a lower value, the chance of a write error is
increased.
MPE/iX Accounting Limits on Disk Space.
MPE/iX allows a system administrator to limit the amount of disk space
that a user may allocate. MPE/iX disk space limitations can be placed
only on MPE/iX accounts and MPE/iX groups; however, a limit placed on an
MPE/iX account or MPE/iX group is also imposed on all hierarchical
directories and files created at all levels beneath that account or
group. No such accounting limits exist for hierarchical directories and
files that are not under MPE/iX accounts and MPE/iX groups.
If a process attempts to write data to a file that would result in the
disk allocation exceeding MPE/iX disk space limitations, an error is
returned, with errno set to EIMPL.
Additional Implementation Considerations
All POSIX/iX library functions that allow you to specify a pathname
return an error and set errno to EIMPL if you attempt to specify a
pathname beginning with two slash characters (//).
The S_ISUID and S_ISGID bits are not currently implemented.
Access permissions are normally passed or returned through POSIX/iX
library functions through a variable of type mode_t. Bits of such a
variable that are not associated with access control bits must be set to
zeros or the function returns an error, with errno set to EIMPL.
On MPE/iX, the file structure associated with directory streams is
implemented using a file descriptor. One effect of this implementation
is encountered when using an exec() function to execute a file. Because
streams are implemented using file descriptors, the file descriptors
associated with the parent's streams remain open for the new process
image and are counted towards the new process image's {OPEN_MAX} count of
open file descriptors; however, these file descriptors are inaccessible
to the new process image.
MPE/iX supports symbolic links on 5.0 or later systems. MPE/iX supports
multiple links to files or hierarchical directories.
All POSIX/iX library functions that allow you to pass a pointer in a
parameter return an error and set errno to EFAULT if the system detects a
NULL or bad address in attempting to evaluate the pointer. The only
exception to this rule is when a NULL value is a valid value to pass in
place of a pointer reference.
MPE/iX 5.0 Documentation