• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[ NS KeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ NS KeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions


  • Subject: [ NS KeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions
  • From: Erg Consultant <email@hidden>
  • Date: Fri, 29 May 2009 22:39:59 -0700 (PDT)

I have an app I install with PackageMaker setting the permissions on the staging dirs to root/admin as mentioned in the Apple docs so that the app gets installed with permissions for any user.

I also install an empty dir with full rwxrwxrwx permissions - this is a data dir that my app will use to write files to at runtime.

So far, so good. Everything works.

In my app I then write a file to that data dir like this:

BOOL flushed = NO;

flushed = [ NSKeyedArchiver archiveRootObject:self toFile:@"/datadir/datafile.dat" ];

Problem is, when this line completes, the permissions on the data dir have changed to the current user/wheel and non-writable for all other users:

drwxr-xr-x@

And the permissions on the data file itself are set to the current user/wheel and:

-rw-r--r--@

Why does archiveRootObject:toFile: change the permissions on the parent directory? I didn't ask it to. This dir has to be writable for all users - the way I installed it - not by only the current user.

How can I avoid having the permissions changed?

Thanks,

Erg




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [ NS KeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions
      • From: Jim Correia <email@hidden>
  • Prev by Date: Custom view resizing
  • Next by Date: Re: Custom view resizing
  • Previous by thread: Re: Custom view resizing
  • Next by thread: Re: [ NS KeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions
  • Index(es):
    • Date
    • Thread