Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing file & directory names



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.