HP 3000 Manuals

Opening a New Disk File [ SPL to HP C/XL Migration Guide ] MPE/iX 5.0 Documentation


SPL to HP C/XL Migration Guide

Opening a New Disk File 

SPL uses the MPE V intrinsic FOPEN to create and open disk files.  FOPEN
allows SPL to have complete control over the definition of a new file.
It returns a file number, filenum, which is used to identify the access
to this file for subsequent I/O operations by other intrinsics, such as
FREAD and FWRITE. If an error occurs, FOPEN returns zero and sets the
condition code to CCL.

In HP C/XL, a file may be created and opened with the library functions
open and fopen or with the MPE XL intrinsics FOPEN and HPFOPEN.

The most preferred and portable is HP C/XL fopen, which returns a stream 
pointer that is used by all of the HP C/XL standard data formatting and
character transfer functions, such as fscanf and fprintf.  If fopen
fails, it returns a null pointer.

If you need the HP C/XL binary read and write functions, or more file
creation control, the open function provides more system-specific
capabilities, which make it less portable.  open returns fildes, a 32-bit
int file descriptor, which may be used to obtain both a stream pointer
and a filenum file number.



MPE/iX 5.0 Documentation