07-15-06 12:19 AM
Jack said the following, on 07/14/06 12:39:
> What is the difference betweeb the two functions? Thanks.
>
First, please put your question in the body of your message, not just in
the Subject: header; that ensures everyone can see it.
The two functions Jack refers to are open(2) and fopen(3).
The open(2) function is a Unix/Linux system call that opens (and
possibly creates) a specified file, and associates it with a file
descriptor (a small positive integer). It is standard in POSIX
environments.
fopen(3) is a function in the standard C library. It opens a specified
file and associates it with a C stream (referred to by a FILE * object).
There are, of course, similarities between the two functions. C, of
course, originated in the UNIX environment, and the C standard attempts
to preserve some features of that environment across platforms. There
is an interesting discussion of the issues involved in P.J. Plauger's
excellent book, _The Standard C Library_.
The man pages have all the details.
--
Rich Gibbs
richg74@gmail.com
"You can observe a lot by watching." -- Yogi Berra
[ Post a follow-up to this message ]
|