Date: Fri, 22 Jan 1999 09:43:08 +0100 (CET) From: Alexander Leidinger <netchild@wurzelausix.CS.Uni-SB.DE> To: current@FreeBSD.ORG Subject: Re: readdir & cd9660 & direntp->d_type == bug (more) Message-ID: <199901220843.JAA22269@wurzelausix> In-Reply-To: <199901191951.UAA01392@Vodix.CS.Uni-SB.de>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi,
attached is the source of a test program.
With the CD of my ISDN card it produces:
{0} <FreeBSD 4.0-CURRENT>
(15) netchild@ttyp1 > ./dirtest /cdrom
/cdrom:
. (type: unknown)
.. (type: unknown)
autorun.inf (type: unknown)
cardware (type: unknown)
doku (type: unknown)
fritz.ico (type: unknown)
fritz! (type: unknown)
intro.hlp (type: unknown)
online (type: unknown)
tools (type: unknown)
winport (type: unknown)
{0} <FreeBSD 4.0-CURRENT>
(16) netchild@ttyp1 > ls -l /cdrom
total 173
-r-xr-xr-x 1 root wheel 54 22 Mai 1998 autorun.inf
dr-xr-xr-x 1 root wheel 2048 27 Mai 1998 cardware
dr-xr-xr-x 1 root wheel 2048 27 Mai 1998 doku
dr-xr-xr-x 1 root wheel 2048 27 Mai 1998 fritz!
-r-xr-xr-x 1 root wheel 766 15 Mai 1998 fritz.ico
-r-xr-xr-x 1 root wheel 75833 22 Mai 1998 intro.hlp
dr-xr-xr-x 1 root wheel 2048 27 Mai 1998 online
dr-xr-xr-x 1 root wheel 2048 27 Mai 1998 tools
dr-xr-xr-x 1 root wheel 2048 27 Mai 1998 winport
Every other CD I tried shows similar results. With ufs or msdos it
displays the correct type (dir, reg, ...).
FreeBSD 4.0-CURRENT #0: Thu Jan 21
Bye,
Alexander.
--
http://netchild.home.pages.de A.Leidinger @ wurzelausix.cs.uni-sb.de
[-- Attachment #2 --]
#define _POSIX_SOURCE
#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
char *types[] =
{
"unknown",
"fifo",
"chr",
"not defined",
"dir",
"not defined",
"blk",
"not defined",
"reg",
"not defined",
"lnk",
"not defined",
"sock",
"not defined",
"wht"
};
int
main(int argc, char **argv)
{
DIR *dir_p;
struct dirent *dent_p;
if(argc != 2)
printf("%s <path>\n", argv[0]);
dir_p = opendir(argv[1]);
if(!dir_p)
exit(1);
printf("\n%s:\n", argv[1]);
while((dent_p = readdir(dir_p)))
{
printf("%-40s (type: %s)\n", dent_p->d_name, types[dent_p->d_type]);
}
if(closedir(dir_p) == -1)
perror("Shit happens");
return 0;
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901220843.JAA22269>
