| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hi Angelo,
Am 21.06.2007 um 12:50 schrieb Angelo Chen:
Hi Mike,
Your method works very well, Thanks. Actually the original name is a FSRef, I tried to avoid that because I'd like to do some process, like this: if original file name has an extension mpeg$, then I have to rename it to mpeg, anyway to do this from a FSRef?
Mike
Thanks,
--- Mike Fischer <email@hidden> 說:FSRenameUnicode(&ref,(UniCharCount)(sizeof(newName)/sizeof
To summarize:
Depending on how you actually get the path to the file in the first place you could do this:
UInt8 x[] = "/Users/justin/Movies/e1.mov"; // Just for illustration. FSRef ref; OSStatus err = FSPathMakeRef(x,&ref,NULL);
if (noErr == err) { // Just for illustration. Use a better method to get the new name in real code: UniChar newName[] = {0x0065, 0x0031, 0x002e, 0x006d, 0x006f, 0x0076, 0x0078};
err =
(UniChar)),newName,kTextEncodingUnknown,NULL); }
HTH Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Web: <http://homepage.mac.com/mike_fischer/index.html> Note: I read this list in digest mode! Send me a private copy for faster responses.
現在你可輕易阻擋垃圾郵件,立即使用Yahoo! Mail你就會相信!
-- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Web: <http://homepage.mac.com/mike_fischer/index.html> Note: I read this list in digest mode! Send me a private copy for faster responses.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.