Re: "Ignore Ownership on this volume" check-box status
Re: "Ignore Ownership on this volume" check-box status
- Subject: Re: "Ignore Ownership on this volume" check-box status
- From: Brian Bergstrand <email@hidden>
- Date: Fri, 16 Apr 2004 10:14:36 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm coming in late on this thread, so forgive me if this is not what
you are looking for.
It sounds like you want to know if permissions are in effect on a
volume. If this is the case, it is a very simple matter to determine,
no need for external tools or hacks.
Get the path to your volume, and then simply call statfs() on the path.
When that returns, check the MNT_UNKNOWNPERMISSONS bit in the f_flags
field. If it is set, then permissions are being ignored on that volume.
Easy.
struct statfs sb;
err = statfs(path, &sb);
if (0 == err && (stat->f_flags & MNT_UNKNOWNPERMISSIONS)) {
... handle disabled perms
}
HTH.
On Apr 16, 2004, at 7:05 AM, Lorenzo wrote:
>
Hi,
>
as you suggested the tool vsdbutil works well, in the Terminal...
>
It tells me when the check-box "Ignore Ownership on this volume" is
>
marked.
>
But [task terminationStatus] returns zero, either when the check-box is
>
marked or is not marked. So, I presume that I am forced to use the
>
returned
>
string in order to understand the status of the check-box.
>
>
vsdbutil returns a string like this
>
Permissions on '/Volumes/Music' are enabled.
>
>
So, in Cocoa I create a string by myself, using stringWithFormat
>
Permissions on '/Volumes/Music' are enabled.
>
>
Then I compare these 2 string and if they are equal, this means that
>
the
>
permissions are enabled. Also I make the NSLog print these 2 strings,
>
and on
>
the log window they really seems to be equal, but the API
>
[enabledResultStr isEqualToString:enabledBaseStr] returns NO all the
>
time.
>
So please, where is my error? In the string encoding?
>
Of course I have to allow even Japanese pathnames in my routine.
>
>
Here's my code.
>
>
Brian Bergstrand <
http://www.bergstrand.org/brian/>, AIM: triryche206
PGP Key: <
http://www.bergstrand.org/brian/misc/public_key.txt>
I can't understand why people are frightened of new ideas. I'm
frightened of the old ones. - John Cage
As of 10:05:04 AM, iTunes is playing "Sweet Amber" from "St. Anger" by
"Metallica"
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3
iQA/AwUBQH/qUnnR2Fu2x7aiEQLLZACglJRU2q8cP7Ffn2d56Az2VEQywccAoLcT
MTMt1F9qPUgHt5NXaAfvN67T
=2tbm
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.