public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD
@ 2006-04-17 22:31 siward at wanadoo dot nl
  2006-04-17 22:48 ` [Bug manual/2581] " siward at wanadoo dot nl
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: siward at wanadoo dot nl @ 2006-04-17 22:31 UTC (permalink / raw)
  To: glibc-bugs

DT_UNKNOWN happens on Debian when reading a file from CD.
I think it would be nice if this could be mentioned in the manual.

(manual only says that some systems can only return DT_UNKNOWN,
  so i thought it only existed for MS-DOS compatibility)

This applies to manual of january 2005 and also to current web version.

have fun !

Siward

-- 
           Summary: DT_UNKNOWN happens on Debian when reading a file from CD
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P2
         Component: manual
        AssignedTo: roland at gnu dot org
        ReportedBy: siward at wanadoo dot nl
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=2581

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/2581] DT_UNKNOWN happens on Debian when reading a file from CD
  2006-04-17 22:31 [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD siward at wanadoo dot nl
@ 2006-04-17 22:48 ` siward at wanadoo dot nl
  2006-04-19 20:47 ` decimal at us dot ibm dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: siward at wanadoo dot nl @ 2006-04-17 22:48 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From siward at wanadoo dot nl  2006-04-17 22:48 -------
P.S. Where i said 'file' i mean regular file. 
     Directories on CDROM have type DT_DIR. 
 

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2581

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/2581] DT_UNKNOWN happens on Debian when reading a file from CD
  2006-04-17 22:31 [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD siward at wanadoo dot nl
  2006-04-17 22:48 ` [Bug manual/2581] " siward at wanadoo dot nl
@ 2006-04-19 20:47 ` decimal at us dot ibm dot com
  2006-04-27  8:15 ` siward at wanadoo dot nl
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: decimal at us dot ibm dot com @ 2006-04-19 20:47 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From decimal at us dot ibm dot com  2006-04-19 20:47 -------
When you say "reading a file" what glibc function are you calling?

When you say "the manual" what manual are you referring to and what section in
the manual are you referring to?

Can you propose text which you think would resolve this problem?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2581

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/2581] DT_UNKNOWN happens on Debian when reading a file from CD
  2006-04-17 22:31 [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD siward at wanadoo dot nl
  2006-04-17 22:48 ` [Bug manual/2581] " siward at wanadoo dot nl
  2006-04-19 20:47 ` decimal at us dot ibm dot com
@ 2006-04-27  8:15 ` siward at wanadoo dot nl
  2006-04-27  8:47 ` siward at wanadoo dot nl
  2006-09-21  4:15 ` aj at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: siward at wanadoo dot nl @ 2006-04-27  8:15 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From siward at wanadoo dot nl  2006-04-27 08:15 -------
Subject: Re:  DT_UNKNOWN happens on Debian when reading a file from CD

On Wednesday 19 April 2006 22:47, decimal at us dot ibm dot com wrote:
> 
> ------- Additional Comments From decimal at us dot ibm dot com  2006-04-19 20:47 -------
> When you say "reading a file" what glibc function are you calling?
> 
> When you say "the manual" what manual are you referring to and what section in
> the manual are you referring to?
info libc, both my version i downloaded at 20050115 and latest version on gnu.org
 15 - File System Interface
 15.2 - Accessing Directories
 READING AND CLOSING A DIRECTORY pf
 struct dirent * readdir( DIR * pd )

> Can you propose text which you think would resolve this problem?
Current text :

  15.2 - Accessing Directories
 FORMAT OF A DIRECTORY ENTRY
 DATATYPE struct dirent
	 unsigned char d_type	 This is type of file, possibly unknown.
				 following constants are defined for its value :
				 DT_UNKNOWN	 Type is unknown.
						 On some systems this is only value returned.
				 DT_REG		 A regular file.

Proposed text :

	 unsigned char d_type	 This is type of file, possibly unknown.
				 following constants are defined for its value :
				 DT_UNKNOWN	 Type is unknown.
						 On Debian this can occur when reading files and directories from CDROM,
						   in that case stat() does show correct filetype.
						 On some systems this is only value returned.
----
It probably happens on all linuxes, not just debian, but i have only seen this on debian.
It may be relevant that i am using a 2.6 kernel,
  so that the ATAPI CDROM is seen by the kernel as a SCSI device,
  without me needing to specify any append clause in my /etc/lilo.conf
---
TEST :

#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>

int main( void ){
  DIR *		  pd	 ;
  struct dirent * psd	 ;
  struct stat	  stats	 ;
  int		  ck	 ;

  pd = opendir("/cdrom"); if( pd == NULL ){ printf("NULL opendir1\n"); return(0); }
  while( NULL != (psd = readdir( pd ) ) ){
    if( 0 == strcmp( psd->d_name, "README.html") ){
      printf("name=%s type=%d DT_UNKNOWN=%d\n",psd->d_name, psd->d_type, DT_UNKNOWN );
      }
    if( 0 == strcmp( psd->d_name, "debian") ){
      printf("name=%s type=%d DT_UNKNOWN=%d\n",psd->d_name, psd->d_type, DT_UNKNOWN );
      }
    }
  ck = stat("/cdrom/README.html", &stats ); if( ck != 0 ){ printf("no stat"); }
  printf("mode=%d isreg=%d isdir=%d\n", stats.st_mode, S_ISREG(stats.st_mode), S_ISDIR(stats.st_mode) );
  ck = stat("/cdrom/debian"     , &stats ); if( ck != 0 ){ printf("no stat"); }
  printf("mode=%d isreg=%d isdir=%d\n", stats.st_mode, S_ISREG(stats.st_mode), S_ISDIR(stats.st_mode) );
  return(0);
  }

TESTOUTPUT:

name=debian type=0 DT_UNKNOWN=0
name=README.html type=0 DT_UNKNOWN=0
mode=33060 isreg=1 isdir=0
mode=16749 isreg=0 isdir=1


----------------------------------------------------------------------------
geen Windows maar Linux :-)


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2581

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/2581] DT_UNKNOWN happens on Debian when reading a file from CD
  2006-04-17 22:31 [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD siward at wanadoo dot nl
                   ` (2 preceding siblings ...)
  2006-04-27  8:15 ` siward at wanadoo dot nl
@ 2006-04-27  8:47 ` siward at wanadoo dot nl
  2006-09-21  4:15 ` aj at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: siward at wanadoo dot nl @ 2006-04-27  8:47 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From siward at wanadoo dot nl  2006-04-27 08:47 -------
(In reply to comment #1)
> P.S. Where i said 'file' i mean regular file. 
>      Directories on CDROM have type DT_DIR. 
>  
OOPS. that was not correct. directories also report DT_UNKNOWN


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2581

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/2581] DT_UNKNOWN happens on Debian when reading a file from CD
  2006-04-17 22:31 [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD siward at wanadoo dot nl
                   ` (3 preceding siblings ...)
  2006-04-27  8:47 ` siward at wanadoo dot nl
@ 2006-09-21  4:15 ` aj at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: aj at suse dot de @ 2006-09-21  4:15 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From aj at suse dot de  2006-09-21 04:15 -------
The description is clear, read it again:
"This is type of file, possibly unknown.".

We will not add distribution specific information.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=2581

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-09-21  4:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-17 22:31 [Bug manual/2581] New: DT_UNKNOWN happens on Debian when reading a file from CD siward at wanadoo dot nl
2006-04-17 22:48 ` [Bug manual/2581] " siward at wanadoo dot nl
2006-04-19 20:47 ` decimal at us dot ibm dot com
2006-04-27  8:15 ` siward at wanadoo dot nl
2006-04-27  8:47 ` siward at wanadoo dot nl
2006-09-21  4:15 ` aj at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).