Hi Pelle,
im really surprised no one ran against this before:
struct dirent in Pelles c only has a dummy and the name but what about the most important Member
d_type ?
d_type==DT_DIR means its a directory
d_type==DT_REG means its a regular file
Without it the functions opendir readdir .. .. are useless becaus i cannot see whats a file and whats a directory
PS im working with version 5.00.6 of PellesC
Greetings
Seltsamuel
Not a bug. Only d_name and d_ino are defined for the dirent structure in POSIX (other fields may exist, but are optional). No action for v6.0, at least.
Hi,
ehm Pelle sorry but then delete this at all because they have no use.
For now i use findfirst findnext but at first i used the other commands for my code because i saw inside the helpfile that PellesC has them
only to delete the code after i saw the missing structure members. When i cannot determine its a file or direntry the complete thing is for the dustbin.
Please remove them and make a reference to findfirst/findnext inside the help thats the better way and at least would have spared my time.
Greetings
Seltsamuel
There are many examples of dirent on the web that are free to download.
John
Hi,
@JohnF
Hi i have examples enough im working mostly on the Linux side and thats the reason i would prefere opendir readdir and closedir
but there is no point in using it with PellesC when the only working structmember is the name of the entry and not the type.
All my examples make heavy usage of "d_type" and there is no point in making fstat on every name readdir delivers ^^.
Greetings
Seltsamuel
Not really a problem - with those examples I talked about you can have any struct member you like by adding it yourself.
John
Hi,
@JohnF
Sure John i can even write my own fwrite and my own printf but that was not the point for this topic ;-)
I only wanted to tell the INCLUDED functions as they are are useless and better exchanged with a reference to other functions that do the work i expect them to do. I did this and Pelle has to decide what to do :-) i for myself have a working workaround.
Greetings
Seltsamuel