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’
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

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS