|
Markus Kohler
|
readdir() sets wrong dirent->d_namelen value?
|
|
Markus Kohler
07/01/2011 8:37 AM
post87017
|
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!
|
|
|
|
|