Mail Archives: djgpp/2001/01/11/08:33:35
On Thu, 11 Jan 2001, Honey LAN >_^ wrote:
> when we work with a file,
> e.g. file_ptr = fopen("filename.ext", "w")
> how C compiler deal with the env with permission?
> i mean if i don't have the correct permission of the file, in this example
> "write", can i work with that file?.........i know the value of the file_ptr
> is returned by the OS.......will the OS just ignore this operation? or
> return any error msg?....thank Q....
If the file in question cannot be written to, the fopen call will fail,
return a NULL pointer in file_ptr, and the global variable `errno' will
be set to the appropriate error code.
- Raw text -