Programming in C.
How can I determine if a filename is file or directory ?
Is there anything similar to java's isDirectory() function in C ?
File or Directory?Determining If a Filename Is a File or a Directory
Page 1 of 1
1 Replies - 1336 Views - Last Post: 10 April 2007 - 09:25 PM
Replies To: File or Directory?
#2
Re: File or Directory?
Posted 10 April 2007 - 09:25 PM
What platform are you one (windows/linux etc). How old is your compiler?
Basicly no. C does not have any built in directory support. There used to be "dir.h" and "dos.h" but they were not standard then and are not standard now.
The big reason for this (though I think it is a cheap excuse) is that directories are a very operating system/platform spacific thing so you need to use your operating system to do this sort of thing.
Now Boost has some directory abilities, and if we know your platform/compiler I am sure your compiler also has a means of doing what you need.
Basicly no. C does not have any built in directory support. There used to be "dir.h" and "dos.h" but they were not standard then and are not standard now.
The big reason for this (though I think it is a cheap excuse) is that directories are a very operating system/platform spacific thing so you need to use your operating system to do this sort of thing.
Now Boost has some directory abilities, and if we know your platform/compiler I am sure your compiler also has a means of doing what you need.
Page 1 of 1