mode | description | starts.. | ||
---|---|---|---|---|
r | rb | open for reading (The file must exist) | beginning | |
w | wb | open for writing (creates file if it doesn't exist). Deletes content and overwrites the file. | beginning | |
a | ab | open for appending (creates file if it doesn't exist) | end | |
r+ | rb+ | r+b | open for reading and writing (The file must exist) | beginning |
w+ | wb+ | w+b | open for reading and writing. If file exists deletes content and overwrites the file, otherwise creates an empty new file | beginning |
a+ | ab+ | a+b | open for reading and writing (append if file exists) | end |
C Programming/stdio.h/fopen mode
最新推荐文章于 2021-05-17 18:03:44 发布