how to know if I have the write access right?
| LeviZhou | |||
| I need to know if I have the write right on directory like "\\machinename\foldername" How can I know if I can write something into this folder using VC/MFC? Thanks | |||
| tsubusa | |||
| Hi, LeviZhou You can use the GetFileAttributes function to get the infomation of the file or a folder, and it is a API function. Also, I think you can use the GetStatus method of the CFile class in the MFC to get the information of the file, and the method returns a CFileStatus object that stores the access of the file. The question is that I don't know whether it can be used for a folder. | |||
| LeviZhou | |||
| Hi, tsubusa Thanks for your reply. I used the GetFileAttributes function, and it returns FILE_ATTRIBUTE_DIRECTORY. may be this means this is just a folder I guess. I'll test GetStatus later. Thank you very much. | |||
| tsubusa | |||
| It's my pleasure. If you have any other question, I wish we can think it over together then. | |||
Registered users can reply in this forum.
