sunmoon
sunmoon

Reputation: 1498

clarity on permissions in windows

I work on linux. I donot have much idea in windows. How the permissions of files are organized in windows? Do we have any api like chmod in unix to change the permissions?

Upvotes: 2

Views: 84

Answers (3)

JUST MY correct OPINION
JUST MY correct OPINION

Reputation: 36117

The security model in Windows NT-based systems is very different from the Unix one that the overwhelming majority of Linux systems use. They work from ACLs (Access Control Lists) and can get very ornate in terms of who gets what permission where. Further they apply to almost every (perhaps even every?) object in the Win32 API, not just files. (This doesn't apply to the pathological FAT file systems if memory serves.)

I would recommend looking closely at how the Win32 security model works before you start messing with tools like cacls (the closest to chmod you're going to find) because you can hurt your system pretty badly if you mess with permissions without understanding them. It's a whole lot more complex than vanilla Linux.

Upvotes: 1

Eli Bendersky
Eli Bendersky

Reputation: 273834

The Win32 API has a function named SetFileAttributes for managing file attributes, among them permissions.

Here's an example from MSDN.

Upvotes: 1

Andrey
Andrey

Reputation: 60115

for windows there is a tool called cacls, but it behaves differently than chmod, so you would better to read docs: http://technet.microsoft.com/en-us/library/bb490872.aspx

Upvotes: 1

Related Questions