What technology to get NTFS permissions in C?

I've thought a lot about how to play with permissions across multiple platforms. Now I am reaching Microsoft Windows and NTFS file / directory permissions.

I have to say that I am working in C. My question is pretty general. I have username and file path.

Do I need more information to check if the user has read / write / execute permission?

What technology should I use? ACL or basic Win32 API? Something else?

Thanks for any help.

0


source to share


1 answer


What's wrong with the Windows API in this case?



GetSecurityInfo from the SDK platform should help. It returns the owner, groups, etc. that are associated with the object (not just files and directories). Then you need to further check the returned information against your username.

+1


source







All Articles