1/10
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
fopen()
function opens the file whose name is the string
pointed to by path and associates a stream with it
mode
f(open)
points to a string beginning with r, r+, w, w+, a, a+
r
Open text file for reading. The stream is positioned at
the beginning of the file.
r+
Open for reading and writing. The stream is positioned at
the beginning of the file.
w
Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.
w+
Open for reading and writing. The file is created if it
does not exist, otherwise it is truncated. The stream is
positioned at the beginning of the file.
a
Open for appending (writing at end of file). The file is created if it does not exist. The stream is positioned at
the end of the file.
a+
Open for reading and appending (writing at end of file). The file is created if it does not exist. Output is always appended to the end of the file. POSIX is silent on what the initial read position is when using this mode. For glibc, the initial file position for reading is at the beginning of the file, but for Android/BSD/MacOS, the initial file position for reading is at the end of the
file.
The result of applying fdopen() to a shared memory object is
undefined
freopen()
function opens the file whose name is the string pointed to by path and associates the stream pointed to by stream
with it. The original stream (if it exists) is closed