Directrory control functions in C

Go4Expert Member
16Oct2007,17:14   #1
Manarg's Avatar
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
DaWei's Avatar
See the stat function.
Go4Expert Member
16Oct2007,21:40   #3
Manarg's Avatar
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
Manarg's Avatar
Quote:
Originally Posted by Manarg
i 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 **files or i might get unexpected results?
.
had many mistakes... quik writing. sorry for that!