• 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: Changing file & directory names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing file & directory names


  • Subject: Re: Changing file & directory names
  • From: Frode <email@hidden>
  • Date: Sun, 2 Jul 2006 11:17:24 +0200

Hi!

2 jul 2006 kl. 09.27 skrev Matt Neuburg:

On Sat, 01 Jul 2006 21:39:52 -0400, Dean Snyder <email@hidden> said:

If I change the contents of the file and save it (using NSTextView
writeRTFDToFile), but do not rename/move the file, then both the
creation date and the modification date are changed to reflect the time
the file was saved. That is clearly wrong behavior - only the
modification date should be changed.

...
It is not a "save" action in the sense you are imagining: it is a "create a file"
action (happily overwriting an existing file if so commanded). You'll find
that -NSString writeToFile:..., for example, is just the same way. And
rightly so; this is a completely new file. The file that was there before,
by the same name, could be anything; nothing guarantees that it is the "same
document". That notion is just something you made up.

Then I suppose all file attributes are clered with this save operation? The actuall process of saving (if an old file exists) would then include getting old attributes with fileAttributesAtPath, then writeRTFDToFile and lastly changeFileAttributes back to the previous attributes (but with the new modification date). However, I think this feels strange, but since you observed -[NSString writeToFile] work similar, it is perhaps a normal behaviour.


/Rog
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Changing file & directory names (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: NSLog() and stderr
  • Next by Date: Re: KVO - Observing self from self
  • Previous by thread: Re: Changing file & directory names
  • Next by thread: Selected range in bound text view
  • Index(es):
    • Date
    • Thread