DataMuseum.dk

Presents historical artifacts from the history of:

ICL Comet 32

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about ICL Comet 32

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦3fca8a6f2⟧ TextFile

    Length: 2049 (0x801)
    Types: TextFile
    Notes: UNIX file
    Names: »fopen.3s«

Derivation

└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
    └─⟦28c352965⟧ »/a« UNIX Filesystem
        └─⟦this⟧ »usr/man/man3/fopen.3s« 

TextFile

.ig
	@(#)fopen.3s	2.1	7/1/84
	@(#)Copyright (C) 1983 by National Semiconductor Corp.
..
.TH FOPEN 3S
.UC 4
.SH NAME
fopen, freopen, fdopen \- open a stream
.SH SYNOPSIS
.B #include <stdio.h>
.PP
.SM
.B FILE
.B *fopen(filename, type)
.br
.B char *filename, *type;
.PP
.SM
.B FILE
.B *freopen(filename, type, stream)
.br
.B char *filename, *type;
.br
.SM
.B FILE
.B *stream;
.PP
.SM
.B FILE
.B *fdopen(fildes, type)
.br
.B char *type;
.SH DESCRIPTION
.I Fopen
opens the file named by
.I filename
and associates a stream with it.
.I Fopen
returns a pointer to be used to identify
the stream in subsequent operations.
.PP
.I Type
is a character string having one of the following values:
.TP 5
"r"
open for reading
.ns
.TP 5
"w"
create for writing
.ns
.TP 5
"a"
append: open for writing at end
of file, or create for writing
.PP
In addition, each
.I type
may be followed by a '+' to have the file opened for
reading and writing.  "r+" positions the 
stream at the beginning of the file, "w+" creates
or truncates it, and "a+" positions it at the end.  Both reads and writes
may be used on read/write streams, with the limitation that an
.I fseek, rewind,
or reading an end-of-file must be used between a read and a write or
vice-versa.
.PP
.I Freopen
substitutes the named file in place
of the open
.IR stream .
It returns the original value of
.IR stream .
The original stream is closed.
.PP
.I Freopen
is typically used to attach the preopened
constant names,
.B stdin, stdout, stderr,
to specified files.
.PP
.I Fdopen
associates a stream with a file descriptor obtained from
.I open, dup, creat,
or
.IR pipe (2).
The
.I type
of the stream must agree with the mode of the open file.
.SH "SEE ALSO"
open(2),
fclose(3)
.SH DIAGNOSTICS
.I Fopen
and 
.I freopen
return the pointer
.SM
.B NULL
if
.I filename
cannot be accessed.
.SH BUGS
.I Fdopen
is not portable to systems other than UNIX.
.PP
The read/write 
.I types
do not exist on all systems.  Those systems without
read/write modes will probably treat the 
.I type
as if the '+' were not
present.