I am trying to read the directory contents throgh the readdir system call.
After getting the directory entry I am testing the type of it by using the folllowing macros S_ISDIR() S_ISREG() etc. But in some systems every file in the directory is displaying like a sub directory. and in some systems every subdirectory is displaying like a file.
For ex :
i am opening the directoy xyz through opendir()
and reading the etnries.
Let us say threre are 3 files and 2 directories.( a , b, c and d1,d2)
S_ISDIR(a or b or c) is returning true in some systems.
S_ISREG(d1 or d2) is returning true in some systems.
But it should not be. In none of the systems I got the correct result
please help out me