How to judge if the folder can be written?
-
How could I judge it, it assume that I have a path like C:\My folder\Myfile\, how to judge if this folder can be written? Note, path may be on a read-only CD or from network with no write privilege, is there a API to complete this function? I tried CreateFile, while it fail with the error code ERROR_ACCESS_DENIED it is have no write privilege, what I want to know is that if there are other methods to do so? 3ks and best regards.
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
-
How could I judge it, it assume that I have a path like C:\My folder\Myfile\, how to judge if this folder can be written? Note, path may be on a read-only CD or from network with no write privilege, is there a API to complete this function? I tried CreateFile, while it fail with the error code ERROR_ACCESS_DENIED it is have no write privilege, what I want to know is that if there are other methods to do so? 3ks and best regards.
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
How about the GetFileAttributes()[^] API? Mark
"Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")
-
How about the GetFileAttributes()[^] API? Mark
"Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")
GetFileAttributes?? I don't think it can work properly. Here I have a path, GetFileAttributes can only get its attribute, how could i know if i can write in the folder. Even the folder is read-only, I can create file in it, right?
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
-
GetFileAttributes?? I don't think it can work properly. Here I have a path, GetFileAttributes can only get its attribute, how could i know if i can write in the folder. Even the folder is read-only, I can create file in it, right?
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
:doh: Oh yeah, sorry :) It seems like checking all the possibilities (security, writable device, etc) would be alot more work than just checking the return from CreateFile(). Maybe there's an easier API - I don't know what it is. Mark
"Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")