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.
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).