From owner-freebsd-current Sat Jan 23 04:40:27 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA27018 for freebsd-current-outgoing; Sat, 23 Jan 1999 04:40:27 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from uni-sb.de (uni-sb.de [134.96.252.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA26904 for ; Sat, 23 Jan 1999 04:39:48 -0800 (PST) (envelope-from netchild@wurzelausix.CS.Uni-SB.DE) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.9.2/1999010400) with ESMTP id NAA13512; Sat, 23 Jan 1999 13:38:27 +0100 (CET) Received: from wurzelausix (wurzelausix.cs.uni-sb.de [134.96.247.1]) by cs.uni-sb.de (8.9.2/1999010400) with ESMTP id NAA15562; Sat, 23 Jan 1999 13:38:26 +0100 (CET) Received: from wurzelausix.cs.uni-sb.de (IDENT:0y3sVnkwndc0Sz3O5Ienw2AMZaIOr0uB@localhost [127.0.0.1]) by wurzelausix (8.9.1/wjp/19980821) with ESMTP id NAA29562; Sat, 23 Jan 1999 13:38:22 +0100 (CET) Message-Id: <199901231238.NAA29562@wurzelausix> Date: Sat, 23 Jan 1999 13:36:53 +0100 (CET) From: Alexander Leidinger Subject: Re: readdir & cd9660 & direntp->d_type == bug (more) To: bde@zeta.org.au cc: current@FreeBSD.ORG In-Reply-To: <199901221132.WAA17787@godzilla.zeta.org.au> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 22 Jan, Bruce Evans wrote: >>/cdrom: >>. (type: unknown) >>.. (type: unknown) >>autorun.inf (type: unknown) > > This is because the cd9660 file system doesn't implement d_type. man dirent or man readdir didn`t note that it`s possible to have this behavior. >>#define _POSIX_SOURCE >> >>#include >>#include >>... >> while((dent_p = readdir(dir_p))) >> { >> printf("%-40s (type: %s)\n", dent_p->d_name, types[dent_p->d_type]); >> } > > This probably shouldn't compile, since d_type isn't in POSIX.1. POSIX.1 It compiles, output above. > only guarantees d_name in struct dirent. Names beginning with d_ are > reserved for use in , but FreeBSD normally attempts to give > strict POSIX.1 if _POSIX_SOURCE is defined. So it`s a bug, but in a different way I want. :( Without _POSIX_SOURCE it didn`t work either. Is it useless, because we can only say "it works _perhaps_" (and we have to stat the entry), or is it a bug? Bye, Alexander. -- http://netchild.home.pages.de A.Leidinger @ wurzelausix.cs.uni-sb.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message