Jump to ID:
Filesystems

Project Home

Documents

Discussions

Wiki

Project Info
Forum Topic - readdir() sets wrong dirent->d_namelen value?: Page 1 of 4 (4 Items)
   
 
 
readdir() sets wrong dirent->d_namelen value?  
Hi everybody,

as written in the QNX documentation on "struct dirent", the "d_namelen" member holds the number of characters of the 
directory entry name, stored in the "d_name" member (not regarding the terminating '\0').

I'm using QNX 6.4.1 on an embedded PPC target. My problem is, that the string length of "d_name" is actually 1 character
 less than "d_namelen" indicates (e.g. a directory entry named "bitmaps" has a "d_namelen" value of 8 instead of 7).

Is this a flaw in QNX 6.4.1, or is there a reasonable explanation to this? One could be, that "d_namelen" in fact 
regards the terminating '\0', or it accounts for a preceeding '/' character (which is however not stored in the "d_name"
 member of the dirent struct)...

I would appreciate any comments on this matter.
Many thanks in advance!