Re: Finder Info

2012-08-27 Thread Sean McBride
On Sat, 25 Aug 2012 17:58:39 +0200, Uli Kusterer said: const UInt8 *cpath = (const UInt8 *)[path cStringUsingEncoding:NSUTF8StringEncoding]; -UTF8String is shorter. Both of these are wrong, though. You should *always* use - fileSystemRepresentation when you need a C-string

Re: Finder Info

2012-08-27 Thread David Duncan
On Aug 27, 2012, at 9:50 AM, Sean McBride s...@rogue-research.com wrote: On Sat, 25 Aug 2012 17:58:39 +0200, Uli Kusterer said: const UInt8 *cpath = (const UInt8 *)[path cStringUsingEncoding:NSUTF8StringEncoding]; -UTF8String is shorter. Both of these are wrong, though. You should

Re: Finder Info

2012-08-27 Thread Ken Thomases
On Aug 27, 2012, at 12:43 PM, David Duncan wrote: On Aug 27, 2012, at 9:50 AM, Sean McBride s...@rogue-research.com wrote: On Sat, 25 Aug 2012 17:58:39 +0200, Uli Kusterer said: const UInt8 *cpath = (const UInt8 *)[path cStringUsingEncoding:NSUTF8StringEncoding]; -UTF8String is

Re: Finder Info

2012-08-25 Thread Mike Abdullah
On 25 Aug 2012, at 06:03 AM, Jens Alfke j...@mooseyard.com wrote: On Aug 24, 2012, at 8:59 PM, koko k...@highrolls.net wrote: Excellent … much easier than Well, in Carbon's defense, you're making things a lot harder than they have to be: if(m_FSRef) free((void*)m_FSRef);

Re: Finder Info

2012-08-25 Thread Charles Srstka
On Aug 25, 2012, at 4:26 AM, Mike Abdullah cocoa...@mikeabdullah.net wrote: On 25 Aug 2012, at 06:03 AM, Jens Alfke j...@mooseyard.com wrote: On Aug 24, 2012, at 8:59 PM, koko k...@highrolls.net wrote: Excellent … much easier than Well, in Carbon's defense, you're making things a lot

Re: Finder Info

2012-08-25 Thread Uli Kusterer
On Aug 25, 2012, at 7:03 AM, Jens Alfke j...@mooseyard.com wrote: On Aug 24, 2012, at 8:59 PM, koko k...@highrolls.net wrote: const UInt8 *cpath = (const UInt8 *)[path cStringUsingEncoding:NSUTF8StringEncoding]; -UTF8String is shorter. Both of these are wrong, though. You should

Finder Info

2012-08-24 Thread koko
I need to set a file's TYPE in the ancient FinderInfo to TEXT as an older program needs to use the file and it OS8 Open filters on TYPE. I have looked at a number of FSSpec and FSRef but have had no success. If anyone has done this successfully I would sure like to hear about it. -koko

Re: Finder Info

2012-08-24 Thread Kyle Sluder
On Fri, Aug 24, 2012, at 11:05 AM, koko wrote: I need to set a file's TYPE in the ancient FinderInfo to TEXT as an older program needs to use the file and it OS8 Open filters on TYPE. I have looked at a number of FSSpec and FSRef but have had no success. If anyone has done this

Re: Finder Info

2012-08-24 Thread koko
On Aug 24, 2012, at 2:02 PM, Kyle Sluder wrote: You want -[NSFileManager setAttributes:ofItemAtPath:error:] in combination with NSFileHFSTypeCode. I forgot to add that the deployment target is 10.4 … which is why I asked … -koko ___ Cocoa-dev

Re: Finder Info

2012-08-24 Thread gweston
koko asked:  I need to set a file's TYPE in the ancient FinderInfo to TEXT as an older program needs to use the file and it OS8 Open filters on TYPE. I have looked at a number of FSSpec and FSRef but have had no success. If anyone has done this successfully I would sure like to hear about

Re: Finder Info

2012-08-24 Thread Kyle Sluder
On Fri, Aug 24, 2012, at 02:35 PM, koko wrote: On Aug 24, 2012, at 2:02 PM, Kyle Sluder wrote: You want -[NSFileManager setAttributes:ofItemAtPath:error:] in combination with NSFileHFSTypeCode. I forgot to add that the deployment target is 10.4 … which is why I asked … Use

Re: Finder Info

2012-08-24 Thread koko
On Aug 24, 2012, at 4:03 PM, Kyle Sluder wrote: FSSetCatalogInfo JUst did a cursory inspection of FSSetCatalogInfo … looks like the ticket. Thanks Kyle, I'll post my results for others and verification. -koko ___ Cocoa-dev mailing list

Re: Finder Info

2012-08-24 Thread Greg Guerin
koko wrote: I forgot to add that the deployment target is 10.4 … which is why I asked … Look at NSFileManager's deprecated methods, and find changeFileAttributes:atPath: . -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Finder Info

2012-08-24 Thread koko
Excellent … much easier than make a FSRef if(m_FSRef) free((void*)m_FSRef); m_FSRef = malloc(sizeof(FSRef)); memset(m_FSRef,0x00,sizeof(FSRef)); const UInt8 *cpath = (const UInt8 *)[path cStringUsingEncoding:NSUTF8StringEncoding]; OSStatus osStatus =

Re: Finder Info

2012-08-24 Thread Jens Alfke
On Aug 24, 2012, at 8:59 PM, koko k...@highrolls.net wrote: Excellent … much easier than Well, in Carbon's defense, you're making things a lot harder than they have to be: if(m_FSRef) free((void*)m_FSRef); m_FSRef = malloc(sizeof(FSRef)); FSRefs don't have to be allocated

Re: Finder Info

2012-08-24 Thread koko
A nice tutorial … thanks! -koko On Aug 24, 2012, at 9:59 PM, koko wrote: Excellent … much easier than make a FSRef if(m_FSRef) free((void*)m_FSRef); m_FSRef = malloc(sizeof(FSRef)); memset(m_FSRef,0x00,sizeof(FSRef)); const UInt8 *cpath = (const UInt8