9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] dirread() and dirreadall()
@ 2005-09-22 22:10 Ronald G Minnich
  2005-09-22 22:18 ` Charles Forsyth
  0 siblings, 1 reply; 6+ messages in thread
From: Ronald G Minnich @ 2005-09-22 22:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-09-22 22:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-22 22:10 [9fans] dirread() and dirreadall() Ronald G Minnich
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

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).