J
Jakob Bieling
Hi,
I was wondering why there are file access modes, which you have to
specify when opening the file. I am specifically talking about the 'read',
'read-write' and 'write' distinction. As far as I can tell, it only makes
sure, you (the programmer) do not accidently write to it when you opened it
for reading. To me, this seems like another one of those things that just
make life harder.
I am asking this, because I am writing a wrapper (not *just* a wrapper,
tho) for file operations with files on a hard disk. Should I provide those
different flags as well? If so, what for? Why don't I just let the user of
the code 'open' the file and read and write to it as she wishes?
Thanks!
I was wondering why there are file access modes, which you have to
specify when opening the file. I am specifically talking about the 'read',
'read-write' and 'write' distinction. As far as I can tell, it only makes
sure, you (the programmer) do not accidently write to it when you opened it
for reading. To me, this seems like another one of those things that just
make life harder.
I am asking this, because I am writing a wrapper (not *just* a wrapper,
tho) for file operations with files on a hard disk. Should I provide those
different flags as well? If so, what for? Why don't I just let the user of
the code 'open' the file and read and write to it as she wishes?
Thanks!