This seems to be a C library thing that isn't available in Pascal.
umask is in System.framework. You could load a function pointer via
CreateBundleForFramework( ... );
CFBundleGetFunctionPointerForName( ... );
and call umask via the function pointer, if Pascal allows this approach.
But the problem I'm now having, is that I also need to set the
DIRECTORY
permission for the directory containing the file, and also its parent.
I've tried doing similar calls, making an FSRef for the directories:
err1 := FSpMakeFSRef ( parentSpec, parentFSRef );
err1 := FSGetCatalogInfo ( parentFSRef, kFSCatInfoPermissions,
@catalogInfo, nil, nil, nil );
catalogInfo.permissions[2] := $1B6; { octal 666 }
err1 := FSSetCatalogInfo ( parentFSRef, kFSCatInfoPermissions,
catalogInfo );
But what I'm getting for the directories, is "no access" for
everybody! Obviously I'm using the wrong constants or something.
Also, where is the right place to look this sort of thing up?
man chmod [in Terminal.app]
"An absolute mode is an octal number constructed from the sum of one or
more of the following values:
...
0400 Allow read by owner.
0200 Allow write by owner.
0100 For files, allow execution by owner. For directories,
allow the owner to search in the directory.
0040 Allow read by group members.
0020 Allow write by group members.
0010 For files, allow execution by group members. For directo-
ries, allow group members to search in the directory.
0004 Allow read by others.
0002 Allow write by others.
0001 For files, allow execution by others. For directories
allow others to search in the directory."
From which you may conclude that you want octal 777 to set free-for-all
on a directory.
Robert P.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden