Why a file needs access mode and what are uses of following file access modes
(a) ‘r’ (b) ‘w’ (c) ‘a’
1
Expert's answer
2011-08-02T14:05:05-0400
A file requires access mode to notify OS about operations a program is going to do with the file. E.g. OS can allow to open a file several times for reading, but only once for writing. Also the current user might be allowed to read some file, but he's not allowed to modify (write) the file. a) 'r' means open for reading only b) 'w' means open for writing only, the previous content of the file is erased c) 'a' means open for writing at the end of the file
Comments
Leave a comment