Answer to Question #3376 in Python for mukunda

Question #3376
Why a file needs access mode and what are uses of following file access modes (a) ‘r’ (b) ‘w’ (c) ‘a’
Expert's answer
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

New on Blog