Re: Changing file & directory names
Re: Changing file & directory names
- Subject: Re: Changing file & directory names
- From: Greg Titus <email@hidden>
- Date: Sat, 1 Jul 2006 10:26:53 -0700
[[NSFileManager defaultManager] movePath:src toPath:dest
handler:handler];
Hope this helps!
- Greg
On Jul 1, 2006, at 10:23 AM, Dean Snyder wrote:
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
_______________________________________________
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