Date: Thu, 11 Jan 2001 15:15:27 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Honey LAN >_^" cc: djgpp AT delorie DOT com Subject: Re: file manipulation.......... In-Reply-To: <93ka9n$e0v1@imsp212.netvigator.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.