![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 333
Rep Power: 3
![]() |
struct dirent: d_type invalid?
i keep getting an error saying that d_type is not a valid member of struct dirent, but isn't this meant to be the field that contains whether the object found is a file or a folder. i am using Dev-C++ 4 here is the code:
Quote:
Last edited by kruptof; May 22nd, 2006 at 5:38 PM. |
|
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 893
Rep Power: 4
![]() |
Use the stat function on the file name that is found and check
(StatBuffer.st_mode & S_IFDIR) != 0 |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Just a tip. "quote" tags don't preserve your indentation, "code" tags do. Thanks for trying, though.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|