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

Changing file & directory names


  • Subject: Changing file & directory names
  • From: Dean Snyder <email@hidden>
  • Date: Sat, 01 Jul 2006 13:23:35 -0400

It took 5 minutes to figure out and implement writing an NSTextView to
an rtfd file; but I've now spent 4 hours simply trying to figure out how
to rename that existing file. I know an rtfd "file" is really a package,
i.e., a directory, but I can't find out how to rename a directory in
Cocoa either.

I've read scores of pages of documentation and looked at source code
examples. (I got tired of navigating TextEdit's save-a-file code trail,
saveAs -> saveDocument -> getDocumentNameAndSave -> doSaveWithName ->
saveToPath in Document.m & DocumentReadWrite.m.

I don't want to actually write the contents of a file, or copy & delete,
etc., I just want to rename an existing file or directory.  You'd think
that [myNSFileWrapper setFilename:newName] or [myNSDocument
setFileURL:newURL], for example, would do the trick; but no, they do not
do what it sounds like they should do, they merely set internal variables.

This should be really simple and really obvious, no?


Dean A. Snyder

Manager, Digital Hammurabi Project
Computer Science Department, Whiting School of Engineering
218C New Engineering Building, 3400 North Charles Street
Johns Hopkins University
Baltimore, Maryland, USA 21218

cell: 717 817-4897
www.jhu.edu/digitalhammurabi/
 _______________________________________________
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: Rosyna <email@hidden>
    • Re: Changing file & directory names
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: QuickTime... No NSMovieView
  • Next by Date: Re: Changing file & directory names
  • Previous by thread: Re: I need help on simple Sketch app and Cocoa bindings
  • Next by thread: Re: Changing file & directory names
  • Index(es):
    • Date
    • Thread