From: "William N. Zanatta" <william@veritel.com.br>
To: mike <ruler@isolate.net>
Cc: xmp <xmp@multipasto.net.co>, linux-c-programming@vger.kernel.org
Subject: Re: Misc C question
Date: Thu, 20 Jun 2002 09:46:53 -0300 [thread overview]
Message-ID: <3D11CEBD.8050102@veritel.com.br> (raw)
In-Reply-To: 002701c21818$8a302d10$0201a8c0@ws1
I think we have a mistake here.
It seems that what was asked is whether the file being opened has or not
a read permission.
Yes, your aplication will compile normally and if you don't have read
permissions on the file, fopen() will return NULL and set errno. By the
way, checking errno is a good way of tracking down errors, try it.
The man page says (both Linux and Solaris):
"Upon successful completion fopen, fdopen and freopen
return a FILE pointer. Otherwise, NULL is returned and
the global variable errno is set to indicate the error."
see ya
william
--
Perl combines all of the worst aspects of BASIC, C and line noise.
-- Keith Packard
Somebody called 'mike' tried to say something! Take a look:
> Hi,
>
> "r" is for readonly, if you don't include what it should do with the file,
> you will get an error on compile. :) The possible options are "r", "w",
> "r+" "w+", and more. You should consult a book/website which will explain
> everything you need to know about them :)
>
next prev parent reply other threads:[~2002-06-20 12:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-20 2:46 Misc C question xmp
2002-06-20 3:10 ` mike
2002-06-20 4:44 ` xmp
2002-06-20 5:08 ` mike
2002-06-20 12:46 ` William N. Zanatta [this message]
2002-06-20 6:28 ` Oleg O. Ossovitskii
2002-06-20 8:05 ` Mohammed Khalid Ansari
2002-06-20 8:51 ` Re[2]: " Oleg O. Ossovitskii
2002-06-20 13:23 ` Glynn Clements
2002-06-20 20:42 ` GOMEZ NOGUERA DAVIDEDUARDO
2002-06-20 21:53 ` James Stevenson
2002-06-20 23:24 ` Glynn Clements
2002-06-20 23:24 ` Glynn Clements
2002-06-21 0:07 ` Christopher Quinn
2002-06-20 18:09 ` James Stevenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D11CEBD.8050102@veritel.com.br \
--to=william@veritel.com.br \
--cc=linux-c-programming@vger.kernel.org \
--cc=ruler@isolate.net \
--cc=xmp@multipasto.net.co \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).