Garth
Garth

Reputation:

Get NTFS file security info using Java or C++

I got stuck with this. I need to get permission info of NTFS files with Java or C++. Those info should be stored in Access Control List (ACL), but I don't know how to retrieve them with Java or C++. Thanks for your help!

Upvotes: 0

Views: 1418

Answers (1)

Oren Trutner
Oren Trutner

Reputation: 24218

With C/C++ on Win32, you could use the GetNamedSecurityInfo API. You get back the file's access control list (the "DACL"), you get the file's owner, group and audit access control list (the "SACL"). The ACL is returned in the somewhat awkward ACL struct. The GetAce API helps a little in retrieving individual entries from the ACL struct.

Upvotes: 1

Related Questions