I want to open some file from my application, file are created by the application itself and can have read or write permission.
I set read permission file with:
chmod 400 path
I want read permission file don’t show unlock dialog when the user try to edit such files.
Is there any FS flags that can help me?
I just notice that if I try to change the owner of the file, the annoying dialog disappear, and the user can just duplicate the file in another place. This is exactly what I’m looking for but, is this the correct way to block a file?
Here 2 images about the involved dialogs


If the file only have read permissions, then it must be that the file system will ask for a password if the owner (or someoneelse) tries to change the file. Normally, one cannot change the owner of a file to some other owner ; that would be a major security hole.
Maybe what you are looking for is the stationary flag ? This will force a user to duplicate the file to work with it, but reading it should be no problem. You get that easily in the finder from the info window for a given file.
This is not a standard unix flag but a hfs thing. You will have to set this using NSFileManager and the method