www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/11/08:33:35

Date: Thu, 11 Jan 2001 15:15:27 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Honey LAN >_^" <honeymak AT yahoo DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: file manipulation..........
In-Reply-To: <93ka9n$e0v1@imsp212.netvigator.com>
Message-ID: <Pine.SUN.3.91.1010111151338.17787D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019