Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,120 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,763 people online right now. Registration is fast and FREE... Join Now!




File or Directory?

 
Reply to this topicStart new topic

File or Directory?, Determining If a Filename Is a File or a Directory

martina
10 Apr, 2007 - 10:03 AM
Post #1

New D.I.C Head
*

Joined: 13 Mar, 2007
Posts: 7


My Contributions
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 ?

User is offlineProfile CardPM
+Quote Post

NickDMax
RE: File Or Directory?
10 Apr, 2007 - 08:25 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:03PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month