• 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: Matt Neuburg <email@hidden>
  • Date: Sun, 02 Jul 2006 00:27:21 -0700
  • Thread-topic: Changing file & directory names

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.

I don't think so. writeRTFDtoFile never promised you a rose garden. 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.

If you want a "save" action, where there *is* a notion of the "same
document", as in the document architecture, then either *use* the document
architecture (which does the right thing for you) or be prepared to manage
more of the housekeeping yourself.

m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
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

  • Follow-Ups:
    • Re: Changing file & directory names
      • From: Frode <email@hidden>
  • Prev by Date: Re: Changing file & directory names
  • Next by Date: Re: Selected range in bound text view
  • Previous by thread: Re: Changing file & directory names
  • Next by thread: Re: Changing file & directory names
  • Index(es):
    • Date
    • Thread