xfs
[Top] [All Lists]

Re: [Bug 245] New: Cannot get type of dirent

To: bugzilla-daemon@xxxxxxxxxxx
Subject: Re: [Bug 245] New: Cannot get type of dirent
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sun, 18 May 2003 17:01:21 +0100
Cc: xfs-master@xxxxxxxxxxx
In-reply-to: <200305181509.h4IF9Haf011294@oss.sgi.com>; from bugzilla-daemon@oss.sgi.com on Sun, May 18, 2003 at 08:09:17AM -0700
References: <200305181509.h4IF9Haf011294@oss.sgi.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
On Sun, May 18, 2003 at 08:09:17AM -0700, bugzilla-daemon@xxxxxxxxxxx wrote:
> XFS cannot find dirent type so cannot get directory type.
> 
> code is as blow..
> 
> #include <stdio.h>
> #include <dirent.h>
> #include <unistd.h>
> #include <stdlib.h>
> int main(void)
> {
>     DIR *dp;
>     struct dirent *ep;
>     char filename[BUFSIZ+1];
>     struct statfs buf;
>     dp = opendir("/");
>     if( dp != NULL ) {
>         while( ep = readdir(dp) ) {
>             sprintf(filename,"/%s", ep->d_name);
>             printf("%s type is %d\n", filename, ep->d_type);
>         }
>     (void) closedir(dp);
>     }
>     return 0;
> }
> 
> that result is 0 that is, UNKOWN type..

Which is what all filesystems that don't support 4.4BSD-style dirents return.
d_type is an optional extension and XFS can't support it without changes in
the ondisk layout.


<Prev in Thread] Current Thread [Next in Thread>