How do I get the access mode that was used to obtain a pariticular file (or file handle)?
Posted on 2004-07-31
I am trying to write a generic file read programe that accept either a CFile or a file handle.
However, when testing it, I sometimes get error because the file was open in an unexpected mode (like write only etc), hence, I would like to examine the CFile or file handle that is passed to the me and see if it is open appropriately. However, I find that there is NO way to examine the way the file was opened (like with 'r' or 'w' etc).
Can any one tell me if there is a way ( as easy as possible) to examine the mode that was used to open this particular file? to avoid errors.