0

I am trying to create a file on mac os. the data from the file will be accessed by the app. but how to create a file having read permission on all accounts. Currently the app can read data in admin account only. I am using following syntax:

BOOL B = [fm createFileAtPath:p1 contents:data attributes:nil];

is it something to do with attributes so that it can be read by all the users but can be modified by admin only.

thank you.

Here is the output of the ls -dl

-rw-r--r--  1 macuser  wheel  137 Aug 23 09:49 /System/Library/testapp/info.txt

is it because I am creating file in system/library, if so which is the best place to create a file so that it will be readable by all users but can be modified by admin only.

thank you

4

1 に答える 1

1

システム/ライブラリにファイルを作成しているためですか、

あなたがAppleであるか、kextをインストールしていない限り、何かを置くのは常に間違った場所です.

…これは、すべてのユーザーが読み取り可能で、管理者のみが変更できるようにファイルを作成するのに最適な場所です。

/Library のどこかにインストールします。

アプリケーション固有のファイルは、/Library の直接のサブフォルダーではなく、/Library/Application Support のサブフォルダーに配置する必要があります。

于 2010-08-23T16:30:51.100 に答える