Is there any way to block access to some particular file or folder in MacOS X, so that it can be protected by password, system-wide?
I want to use it in Cocoa based program, but before that I just want to know at least general possible methods of accomplishing it.
As far as I know POSIX file access system doesn’t allow to protect something with password.
I was thinking about creating additional user account with dedicated password and then setting this user as an owner of a file with chmod. In terminal it seemed to work, but that is quite bad way, I think, since that is a sort of permission problem. And you need to change user in terminal for that. I don’t think that can be done if one wants to access it through regular application like Finder.
So does anybody know better ways?
Is there any way to block access to some particular file or folder in
Share
To create a password protected “folder” you can use an encrypted disk image and mount it at the location you require the folder. The command
hdiutilcan be used to create, mount, unmount etc. such disk images. Use the the-plistoption to easily drive thehdiutilcommand from Objective-C.