From: Ronald G Minnich <rminnich@lanl.gov>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: [9fans] dirread() and dirreadall()
Date: Thu, 22 Sep 2005 16:10:26 -0600 [thread overview]
Message-ID: <43332BD2.2040007@lanl.gov> (raw)
As I read the man page for dirread(), it kind of implies that it returns
an array of entries, and also implies that it returns one dir entry at a
time.
"It [dirread] reads from fd and unpacks the data into an
array of Dir structures whose address is returned in *buf (see stat(3)
for the layout of a Dir)."
but
" by contrast, dirread steps through a directory one read(3) at a time."
Anyways, FWIW, dirread reads in as much as it can, up to a limit of
DIRMAX bytes, and fails if it can not allocate that much; and dirreadall
reads in as much as it can, up to a limit of allocatable memory, and
fails if it can not allocate that much.
For dirreadone(), I think, ya rolls yer own.
apologies if the error here is my inability to parse english.
ron
next reply other threads:[~2005-09-22 22:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-22 22:10 Ronald G Minnich [this message]
2005-09-22 22:18 ` Charles Forsyth
2005-09-22 22:26 ` Ronald G Minnich
2005-09-22 22:33 ` Russ Cox
2005-09-22 22:44 ` Ronald G Minnich
2005-09-22 22:49 ` Ronald G Minnich
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=43332BD2.2040007@lanl.gov \
--to=rminnich@lanl.gov \
--cc=9fans@cse.psu.edu \
/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).