WinAPI way to determine if a file is accessible/private

前端 未结 3 1495
囚心锁ツ
囚心锁ツ 2021-01-22 13:04

In win32 c++; is there a way to determine if a folder/file is accessible? You know how if you try to access a certain folder in the C:/Windows directory & you will get a pop

3条回答
  •  没有蜡笔的小新
    2021-01-22 13:31

    Best thing to do is just try to access it.

    You can calculate the access granted by the access control list for a particular user account, but this is quite complicated, and the permission could change after you do the access check. So just open the file and handle access denied errors.

提交回复
热议问题