Directrory control functions in C
|
Go4Expert Member
|
|
| 16Oct2007,17:14 | #1 |
|
Hello. Is there any function that can specify if a given path points to a directory or to a file? I want it to work in Unix-based operating systems. Any help will be appreciated! Thanx in advance.
|
|
Team Leader
|
![]() |
| 16Oct2007,18:22 | #2 |
|
See the stat function.
|
|
Go4Expert Member
|
|
| 16Oct2007,21:40 | #3 |
|
i was used the stat function but when the path is a directory the st_mode element of the stat struct does not get the S_IFDIR value but a value close to that (on int). why is this happening?
is it safe to use a range of values for directories and another range for values or i might get unexpected results? (actually i want to test weather a given path is a file or a directory). |
|
Go4Expert Member
|
|
| 16Oct2007,21:53 | #4 |
|
Quote:
Originally Posted by Manarg
|

