FROM : Dean Snyder
DATE : Sat Jul 01 19:23:35 2006
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/
DATE : Sat Jul 01 19:23:35 2006
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/






Cocoa mail archive

