Directrory control functions in C

Manarg's Avatar, Join Date: Jun 2007
Go4Expert Member
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.
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
See the stat function.
0
Manarg's Avatar, Join Date: Jun 2007
Go4Expert Member
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).
0
Manarg's Avatar, Join Date: Jun 2007
Go4Expert Member
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!