Directory path validation problem
-
Hey all, I have to validate the path of a directory i.e the directory path is valid or not. pls help me.
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
-
Hey all, I have to validate the path of a directory i.e the directory path is valid or not. pls help me.
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
PathIsDirectory()
Perhaps next time you could look in the documentation[^]Waldermort
-
PathIsDirectory()
Perhaps next time you could look in the documentation[^]Waldermort
Interesting... How you discover that that's the function? By reading all the 10000 pages in strict alphabetical order?
2 bugs found. > recompile ... 65534 bugs found. :doh:
-
Interesting... How you discover that that's the function? By reading all the 10000 pages in strict alphabetical order?
2 bugs found. > recompile ... 65534 bugs found. :doh:
It doesn't take much effort to type into that little box they call "Search" and then click the button called "go"...
Waldermort
-
Hey all, I have to validate the path of a directory i.e the directory path is valid or not. pls help me.
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
Hi, here is another option
BOOL IsDirectory(TCHAR *szPath) { BOOL bRet = FALSE; DWORD dwResult = GetFileAttributes(szPath); if(dwResult != 0xffffffff && (dwResult & FILE_ATTRIBUTE_DIRECTORY)) { bRet = TRUE; } return bRet; }
Best Wishes, -Randor (David Delaune) -
It doesn't take much effort to type into that little box they call "Search" and then click the button called "go"...
Waldermort
in theory yes, but with the new MSDN it becomes a nightmare...
2 bugs found. > recompile ... 65534 bugs found. :doh:
-
in theory yes, but with the new MSDN it becomes a nightmare...
2 bugs found. > recompile ... 65534 bugs found. :doh:
-
Hey all, I have to validate the path of a directory i.e the directory path is valid or not. pls help me.
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
DWORD dwFileAttrib = 0; dwFileAttrib = GetFileAttributes(pathof Directory); if(dwFileAttrib == -1 || (dwFileAttrib & FILE_ATTRIBUTE_DIRECTORY) == 0) { AfxMessageBox("Directory path not exist"); }
kamalesh
-
Hey all, I have to validate the path of a directory i.e the directory path is valid or not. pls help me.
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
Karismatic wrote:
I have to validate the path of a directory...
What does "validate" mean? Are you wanting to check if it has invalid characters, or whether it exists?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Interesting... How you discover that that's the function? By reading all the 10000 pages in strict alphabetical order?
2 bugs found. > recompile ... 65534 bugs found. :doh:
emilio_grv wrote:
By reading all the 10000 pages...
No, just the ones up to the function that you are interested in. All the pages after that do not need to be read, unless you just wanted to.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne