Help!....I need a code to find a file is read only or not
-
Hi, I need a code to find if a file in Windows NT is read only or not. The file attribute is not marked read only, but it was made read only using the file security settings (i.e NTExplorer->File->RightMouseClick->Properties->Security->Add->Everyone->Read). I would appreciate if some one help me find a code which will look through the file ACL(Access Control List) and determine if a file is read only or not. Thanks Kumar
-
Hi, I need a code to find if a file in Windows NT is read only or not. The file attribute is not marked read only, but it was made read only using the file security settings (i.e NTExplorer->File->RightMouseClick->Properties->Security->Add->Everyone->Read). I would appreciate if some one help me find a code which will look through the file ACL(Access Control List) and determine if a file is read only or not. Thanks Kumar
> I need a code to find if a file in Windows NT is read only > or not. The file attribute is not marked read only, but it > was made read only using the file security settings The file isn't read only, it's just that the user don't have the privs to read it. Please don't mix the two concepts of security and DOS flags from the early '80s. You are right you have to check the ACL(s), and this is not something I'd recommend if you only want to know if a user (you?) can read it or not. Just try to open it read-only and find out. GetLastError should give you an appropriate resonse. (without testing I'd say the only possible response would be ERROR_ACCESS_DENIED if you don't have the privs, but knowing MS...)