NSDocument: File attributes for backup file?
NSDocument: File attributes for backup file?
- Subject: NSDocument: File attributes for backup file?
- From: Manfred Lippert <email@hidden>
- Date: Wed, 30 Jan 2002 13:37:06 +0100
Hi,
I have a subclass of NSDocument that sets some file attributes to the saved
files by overriding fileAttributesToWriteToFile:ofType:saveOperation.
I also want to keep backups of the files, so I override keepBackupFile to
return YES.
The problem: The backup files do *not* have the attributes I gave the
original files. :-( Especially these are HFS Type/Creator and Posix Access
Permissions. But I really need those attributes also on the backup files.
What is the best way to give the same attributes to my backup files?
I don't want to rewrite the entire saving code ...
If I have to: has someone sample code for me? That would be great.
Another problem:
NSDocument seems to make a backup by renaming "file.ext" to "file~.ext".
Could it be that the Finder doesn't recognize the extension of those backups
as extension anymore?? If I hide extensions in the Finder, only the
extensions of the original files are hidden, and also a double click on
backup files does not launch the right application. (But maybe this has to
do with missing HFS Type/Creator-Codes?)
Thanks,
Mani