🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #120

Re: Query about <dirent.h>

#120
From: Moderator, John S. Quarterman
Date: Sat, 25 Nov 1989 19:33
17 lines
1310 bytes
From: Andy Tanenbaum <uunet!cs.vu.nl!ast>

In article <442@longway.TIC.COM> gwyn@brl.arpa (Doug Gwyn) writes:
>That's what happens when programmers assume things that are not promised
>by the standards.
I don't follow.  What is it that that the standards don't promise.  Surely
a programmer may declare a struct dirent, since readdir() returns a pointer
to one of them.  Furthermore, a programmer may assume that d_name is an
array of characters that can hold a file name.  I don't see how you can
put a file name in 1 character.  I don't see any alternative than to
allocate NAME_MAX+1 characters there.  Why doesn't the standard require
<dirent.h> to have <limits.h> as a prerequisite, so that NAME_MAX
is at least known.

Andy Tanenbaum (ast@cs.vu.nl)

Volume-Number: Volume 17, Number 72
Technical Details
Message-ID: <444@longway.TIC.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!longway!std-unix
References: <437@longway.TIC.COM> <438@longway.TIC.COM> <441@longway.TIC.COM> <442@longway.TIC.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!longway!std-unix
From: std-unix@longway.TIC.COM (Moderator, John S. Quarterman)
Newsgroups: comp.std.unix
Subject: Re: Query about <dirent.h>
Message-ID: <444@longway.TIC.COM>
Date: 25 Nov 89 19:33:54 GMT
References: <437@longway.TIC.COM> <438@longway.TIC.COM> <441@longway.TIC.COM> <442@longway.TIC.COM>
Reply-To: Andy Tanenbaum <uunet!cs.vu.nl!ast>
Organization: VU Informatica, Amsterdam
Lines: 17
Approved: jsq@longway.tic.com (Moderator, John S. Quarterman)