home *** CD-ROM | disk | FTP | other *** search
- stdio/fhopen stdio/fhopen
-
- NAME
- fhopen - associate a file pointer with an already open AmigaDOS
- file handle
-
- SYNOPSIS
- #include <dos/dos.h>
- #include <stdio.h>
-
- FILE *fp = fhopen(fh, modes);
- BPTR fh;
- char *modes;
-
- FUNCTION
- fhopen associates an already open AmigaDOS file handle with a
- file pointer. Note that fclose()ing the file pointer will also
- Close() the file handle - use fhclose() if you want to free the
- file pointer but still use the file handle.
-
- Refer to the fopen manual page for a description of available
- modes. Note that when you use fhopen the file will not be
- truncated.
-
- The mode string should be similar to the access mode that was
- used to open the file handle:
- MODE_READWRITE "w+" or "r+"
- MODE_OLDFILE "r"
- MODE_NEWFILE "w" or "a"
- Using an append mode will cause a Seek() to the end of file.
-
- NOTE
- refer to the file_pointer manual page for general information
-
- INPUTS
- BPTR fh; BCPL pointer to a file handle
- char *modes; modes string, such as "r+".
-
- RESULTS
- FILE *fp; new file pointer or NULL if an error occured
-
- SEE ALSO
- fhclose, fdopen, fopen, dos.library/Open
-
-
- stdio/fhclose stdio/fhclose
-
- NAME
- fhclose - close file pointer from fhopen() without closing
- AmigaDOS file handle
-
- SYNOPSIS
- #include <dos/dos.h>
- #include <stdio.h>
-
- int error = fhclose(fp);
- FILE *fp;
-
- FUNCTION
- fhclose flushes any data remaining in the file pointer's output
- buffer and then frees the file pointer, but without closing the
- file handle. The file pointer is no longer valid, but the
- file handle is.
-
- fclose returns any error condition that occured while flushing
- the buffered data to the file. The file pointer is still free'd
- even if an error occurs.
-
- NOTE
- refer to the file_pointer manual page for general information
-
- INPUTS
- FILE *fp; file pointer from fhopen()
-
- RESULTS
- int error; error number, or 0 if none
-
- SEE ALSO
- fhopen, fclose, dos.library/Close
-
-