🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #119

Re: Query about <dirent.h>

#119
From: Mark H. Colburn
Date: Fri, 24 Nov 1989 12:58
26 lines
1383 bytes
From: mark@jhereg.Minnetech.MN.ORG (Mark H. Colburn)

In article <437@longway.TIC.COM> Andy Tanenbaum <uunet!cs.vu.nl!ast> writes:
>From: Andy Tanenbaum <uunet!cs.vu.nl!ast>
>
>The <dirent.h> header is required by P1003.1 to have a field
>	d_name []
>
>Now the question arises about what size to use there.  One possibility is
>	d_name[NAME_MAX+1]
>

At least three implementations that I know of define dname as follows:

	d_name[1];

And, they put it at the end of the strucutre.  In this way, when the
structure is allocated, the implementation may allocate enough space for
the directory name, no matter what it is.  For a good, publicly available
example, you might want to check out Doug Gwyn's dirent library.

-- 
Mark H. Colburn                       mark@Minnetech.MN.ORG
Open Systems Architects, Inc.

Volume-Number: Volume 17, Number 71
Technical Details
Message-ID: <443@longway.TIC.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!cs.utexas.edu!longway!std-unix
References: <437@longway.TIC.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!cs.utexas.edu!longway!std-unix
From: mark@jhereg.Minnetech.MN.ORG (Mark H. Colburn)
Newsgroups: comp.std.unix
Subject: Re: Query about <dirent.h>
Message-ID: <443@longway.TIC.COM>
Date: 24 Nov 89 12:58:23 GMT
References: <437@longway.TIC.COM>
Sender: std-unix@longway.TIC.COM
Reply-To: mark@jhereg.Minnetech.MN.ORG (Mark H. Colburn)
Organization: Open Systems Architects, Inc., Mpls, MN
Lines: 26
Approved: jsq@longway.tic.com (Moderator, John S. Quarterman)