Getting correct file extension
Getting correct file extension
- Subject: Getting correct file extension
- From: Arved von Brasch <email@hidden>
- Date: Tue, 6 Jun 2006 00:48:01 +1000
Greetings Cocoa Dev list,
My application allows importing of QuickTime supported files. It
allows opening of these files through an NSOpenPanel with the file
types set to:
[QTMovie movieFileTypes: QTIncludeCommonTypes |
QTIncludeStillImageTypes]
Some of these files do not have extensions. After doing my thing
with the files, I want to save them to a different location, but with
the correct file extension for the kind of QuickTime file it is.
That is, if an MPEG file is opened without an extension, when saved
it should have an '.mpg' extension. When a MooV file is opened, it
should have a '.mov' extension when saved. I believe I can use
Launch Services to do this, but have almost no experience with Carbon
and am unsure of how to proceed.
In the launch services documentation 'Launch Services Concepts and
Tasks' under 'The Launch Services Database' it mentions
CFBundleTypeExtensions as a key to a dictionary that describes
document types. This sounds perfect. I have access to an NSString
describing the full file path of the original file. I would prefer
not to have to create a QTMovie object to get the extension because
that may require firing a fault in my CoreData back end. Once I get
this promised array, how do I convert it back into an NSArray of
NSStrings?
Thank you for any help,
Arved von Brasch
_______________________________________________
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