From: LDB <thesource@ldb-jab.org>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Testing if a file or directory exist
Date: Sun, 09 Sep 2007 11:04:58 -0400 [thread overview]
Message-ID: <46E40B9A.4020709@master.ldb-jab.org> (raw)
In-Reply-To: <1189333013.9615.2.camel@chimay>
Agreed, by definition access() does the following:
access() checks whether the process would be allowed to read, write or test for
existence of the file (or other file system object) whose name is pathname.
LDB
Benoit Rouits wrote:
> I think, as information are not needed, even access() is better than
> stat() and also uses less memory/cpu.
> - ben
> Le dimanche 09 septembre 2007 à 06:07 -0400, Robert P. J. Day a écrit :
>> if all you want to do is check for existence, then, execution time
>> notwithstanding, you should use the method which accomplishes that and
>> nothing more, so the obvious solution would be stat().
>>
>> it would be illogical to call open() since a side-effect would be that
>> you then had an open file. in short, if you just want to test, then
>> just test.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2007-09-09 15:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-09 9:26 Testing if a file or directory exist Holger Kiehl
2007-09-09 10:07 ` Robert P. J. Day
2007-09-09 10:16 ` Benoit Rouits
2007-09-09 15:04 ` LDB [this message]
2007-09-10 15:53 ` Holger Kiehl
2007-09-10 18:01 ` Glynn Clements
2007-09-09 13:15 ` Glynn Clements
2007-09-10 15:39 ` Holger Kiehl
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=46E40B9A.4020709@master.ldb-jab.org \
--to=thesource@ldb-jab.org \
--cc=linux-c-programming@vger.kernel.org \
/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).