Is there any way for me to check for a directory in C or C++...in Java there is an isDirectory() function
Thanks.
Stan
Printable View
Is there any way for me to check for a directory in C or C++...in Java there is an isDirectory() function
Thanks.
Stan
That's compiler/OS specific. What are you using?
Is there any way for me to check for a directory in C or C++...in Java there is an isDirectory() function
Im using Micosoft Visual C++
Thanks.
Stan
Click in 'Post reply' to reply an message, instead writing a new one.
Im using Microsoft Visual C++ 6.0
http://msdn.microsoft.com/library/de...sdirectory.asp
you'll find sure, what you're searching.
Thanks Vber ....I appreciate the help, if u ever need a vacation then mi casa es su casa
No problem ;)Quote:
Thanks Vber ....I appreciate the help, if u ever need a vacation then mi casa es su casa
How do i delete a file once i have ascertained it is a file ?
thanks
If you want a standard C method, try this, else search MSDN if you want an MS specific version.Quote:
Originally posted by yardy
How do i delete a file once i have ascertained it is a file ?
thanks
Since this is a C board, here is a method to determine if a path is a directory in WinApi C.
And here is the link for DeleteFile:Code:attrib = GetFileAttributes(path);
if ( attrib == 0xFFFFFFFF || !(attrib & FILE_ATTRIBUTE_DIRECTORY) ){
/* not a valid directory */
}
http://msdn.microsoft.com/library/de...deletefile.asp
Note: Google is far more effective for searching msdn than the ms search engine.
Have Fun!
Hi
I am wondering if there is a similar method or standard function I can use on UNIX platform ( Though I could not find one in any manulas I looked at)?
I would like to ensure that a directory path is valid before I start processing. At the point I do this I do not know if the directory has any files in it.
Thanks in advance.
Mike