• 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
Re: Determining read-only
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining read-only


  • Subject: Re: Determining read-only
  • From: David Rio Vierra <email@hidden>
  • Date: Wed, 15 Jan 2003 20:23:19 -1000

Well, you have to override this one in order to check attributes of the file you're opening:

- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type

Normally, you shouldn't need to check for your input file being read-only, since you will only be reading from it anyway. The user will be unable to replace the read-only file when he tries to save his document, and will be forced to save it elsewhere.

To create a read-only file, there are a few NSFileManager methods like -changeFileAttributes:atPath: and -createFileAtPath:contents:attributes:
The attributes dictionary should contain for the key NSFilePosixPermissions an NSNumber representing the file's permissions. Read the chmod manpage for more information about numeric file permissions.

On Wednesday, January 15, 2003, at 07:43 PM, Francisco Tolmasky wrote:

From NSDocument,

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType

how can you determine if the file someone is opening is read only, and
how can you create read-only output?

Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Determining read-only (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: FSRef -> NSString
  • Next by Date: Re: FSRef -> NSString
  • Previous by thread: Determining read-only
  • Next by thread: How to "touch" a folder?
  • Index(es):
    • Date
    • Thread