Re: Why is NSString-FSRef so hard?

2009-05-04 Thread Uli Kusterer
On 29.04.2009, at 15:15, Mark Douma wrote: If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining / to be the component you should be separating by. What if someone had your app inside of a folder they named Apps/Utilities? The

Re: Why is NSString-FSRef so hard?

2009-05-04 Thread Uli Kusterer
On 30.04.2009, at 13:12, Alastair Houghton wrote: 3. AFAIK the Carbon layer maps them back again. Carbon's filesystem functions are implemented on top of the BSD layer, not alongside it as some people assume (OK, OK, there is the .vol special folder and there are a couple of additional

Re: Why is NSString-FSRef so hard?

2009-04-30 Thread ERG Consultant
/ has been in use since the inception of unix in 1970 that's 39 years. I seriously doubt it's going to change anytime soon. In 39 more years, i'll be dead. ERG Sent from my iPod On Apr 29, 2009, at 8:50 PM, Michael Ash michael@gmail.com wrote: On Wed, Apr 29, 2009 at 10:22 PM, Andrew

Re: Why is NSString-FSRef so hard?

2009-04-30 Thread Kyle Sluder
On Thu, Apr 30, 2009 at 4:32 AM, ERG Consultant erg_consult...@yahoo.com wrote: / has been in use since the inception of unix in 1970 that's 39 years. I seriously doubt it's going to change anytime soon. In 39 more years, i'll be dead. Cocoa is derived from Openstep (or OPENSTEP, or

Re: Why is NSString-FSRef so hard?

2009-04-30 Thread Alastair Houghton
On 30 Apr 2009, at 05:02, Charles Srstka wrote: Carbon and the Finder are displaying the filenames as is, as HFS allows slashes to be in a filename, and the colon is the separator. Cocoa and the BSD layer, on the other hand, do swap the slashes and colons. Presumably the idea is to display

Re: Why is NSString-FSRef so hard?

2009-04-30 Thread Andy Lee
On Apr 30, 2009, at 4:52 AM, Kyle Sluder wrote: In other words, why not just use the damn API? It's not like you need to deposit a coin to make a function call. If you did, we wouldn't have toll-free bridging. --Andy ___ Cocoa-dev mailing list

Re: Why is NSString-FSRef so hard?

2009-04-30 Thread Marcel Weiher
On 29.Apr, 2009, at 21:02 , Charles Srstka wrote: On 29 Apr 09, at 06:15, Mark Douma wrote: Carbon and the Finder are displaying the filenames as is, as HFS allows slashes to be in a filename, and the colon is the separator. Cocoa and the BSD layer, on the other hand, do swap the slashes

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Mark Douma
On Apr 28, 2009, at 1:34 AM, Erg Consultant wrote: if( glBundle ) { // Get main bundle info dict... d = [ glBundle infoDictionary ]; if( d ) { // Get the GL bundle's path from the info dict... z = [ d objectForKey:kNSBundleInitialPathInfoDictKey

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Andrew Farmer
On 29 Apr 09, at 06:15, Mark Douma wrote: If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining / to be the component you should be separating by. What if someone had your app inside of a folder they named Apps/Utilities? The

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Michael Ash
On Wed, Apr 29, 2009 at 10:22 PM, Andrew Farmer andf...@gmail.com wrote: On 29 Apr 09, at 06:15, Mark Douma wrote: If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining / to be the component you should be separating by. What if

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Charles Srstka
On Apr 29, 2009, at 9:22 PM, Andrew Farmer wrote: On 29 Apr 09, at 06:15, Mark Douma wrote: If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining / to be the component you should be separating by. What if someone had your app

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Jim Correia
On Thu, Apr 30, 2009 at 12:02 AM, Charles Srstka cocoa...@charlessoft.com wrote: With that said, I don't really see what is harmful about recommending the use of NSString's path concatenation methods, which could save quite a few headaches in the case that this *does* somehow change for some

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Michael Ash
On Thu, Apr 30, 2009 at 12:02 AM, Charles Srstka cocoa...@charlessoft.com wrote: With that said, I don't really see what is harmful about recommending the use of NSString's path concatenation methods, which could save quite a few headaches in the case that this *does* somehow change for some

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Stephen J. Butler
On Tue, Apr 28, 2009 at 12:21 AM, Erg Consultant erg_consult...@yahoo.com wrote: LSOpenCFURLRef doesn't work either - kLSApplicationNotFoundErr. The nature of the file is the app's exe which is normally inside the MacOS dir. However, all this works perfectly fine if there are no special

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Erg Consultant
is NSString-FSRef so hard? On Tue, Apr 28, 2009 at 12:21 AM, Erg Consultant erg_consult...@yahoo.com wrote: LSOpenCFURLRef doesn't work either - kLSApplicationNotFoundErr. The nature of the file is the app's exe which is normally inside the MacOS dir. However, all this works perfectly fine

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Chris Hanson
On Apr 27, 2009, at 9:14 PM, Erg Consultant wrote: I write the original STL string to a tmp file, then read it back in. The file is encoded in MacRoman. I tried UTF8 with both converting and reinterpreting but if I use UTF8 when I read it back from file, the read returns nil. If I use

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Erg Consultant
erg_consult...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Tuesday, April 28, 2009 12:22:38 AM Subject: Re: Why is NSString-FSRef so hard? On Apr 27, 2009, at 9:14 PM, Erg Consultant wrote: I write the original STL string to a tmp file, then read it back in. The file is encoded in MacRoman. I

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Michael Ash
On Tue, Apr 28, 2009 at 1:13 AM, Erg Consultant erg_consult...@yahoo.com wrote: Apple's doc's specifically say to stay away from using the CString routines which require encodings. So now the encoding issue goes away. The problem is LSOpenApplication() does not like the FSRef I pass it which

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Clark Cox
On Mon, Apr 27, 2009 at 10:13 PM, Erg Consultant erg_consult...@yahoo.com wrote: Apple's doc's specifically say to stay away from using the CString routines which require encodings. Where do they say that? -- Clark S. Cox III clarkc...@gmail.com

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Jean-Daniel Dupas
Le 28 avr. 09 à 17:47, Michael Ash a écrit : On Tue, Apr 28, 2009 at 1:13 AM, Erg Consultant erg_consult...@yahoo.com wrote: Apple's doc's specifically say to stay away from using the CString routines which require encodings. So now the encoding issue goes away. The problem is

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Erg Consultant
: cocoa-dev cocoa-dev@lists.apple.com Sent: Tuesday, April 28, 2009 9:07:00 AM Subject: Re: Why is NSString-FSRef so hard? On Mon, Apr 27, 2009 at 10:13 PM, Erg Consultant erg_consult...@yahoo.com wrote: Apple's doc's specifically say to stay away from using the CString routines which require

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Erg Consultant
: Tuesday, April 28, 2009 9:59:07 AM Subject: Re: Why is NSString-FSRef so hard? Le 28 avr. 09 à 17:47, Michael Ash a écrit : On Tue, Apr 28, 2009 at 1:13 AM, Erg Consultant erg_consult...@yahoo.com wrote: Apple's doc's specifically say to stay away from using the CString routines which require

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Kyle Sluder
On Tue, Apr 28, 2009 at 5:03 PM, Erg Consultant erg_consult...@yahoo.com wrote: How does one launch an exe inside an app bundle if LSOpenApplication isn't desgined to do that? exe? You need to specify what you mean: executable binary, which is just a plain binary file, or application, which

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Erg Consultant
Subject: Re: Why is NSString-FSRef so hard? On Tue, Apr 28, 2009 at 5:03 PM, Erg Consultant erg_consult...@yahoo.com wrote: How does one launch an exe inside an app bundle if LSOpenApplication isn't desgined to do that? exe? You need to specify what you mean: executable binary, which is just

Re: Why is NSString-FSRef so hard?

2009-04-28 Thread Charles Srstka
On Apr 28, 2009, at 4:13 PM, Erg Consultant wrote: This is a DRM situation where there are multiple app executables inside the main .app bundle. NSTask. Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
, 2009 4:41:20 PM Subject: Re: Why is NSString-FSRef so hard? On Apr 25, 2009, at 5:33 PM, Erg Consultant wrote: Isn't there some easy way to get an FSRef from an NSString that is a path containing special characters? What, specifically, have you tried? I don't think I've ever had

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
however does not work - the special characters get mangled. Erg From: Ken Thomases k...@codeweavers.com To: Erg Consultant erg_consult...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Saturday, April 25, 2009 6:12:33 PM Subject: Re: Why is NSString-FSRef so hard

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
Are NSURL and CFURL not toll-free bridged? Erg From: Sean McBride cwat...@cam.org To: Erg Consultant erg_consult...@yahoo.com; cocoa-dev@lists.apple.com Sent: Sunday, April 26, 2009 2:41:20 PM Subject: Re: Why is NSString-FSRef so hard? Erg Consultant (erg_consult

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Ken Thomases
On Apr 27, 2009, at 11:26 PM, Erg Consultant wrote: One other thing I should mention - the mangled char in question is the tm symbol (option-2). In its string form, the debugger shows it as the tm char. But when I convert the string to an NSURL using fileURLWithPath, and then do a

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Michael Ash
On Tue, Apr 28, 2009 at 12:51 AM, Erg Consultant erg_consult...@yahoo.com wrote: So why isn't it working? Why does LSOpenApplication give me an error? It is impossible to answer questions of this nature if you do not post your code. Mike ___

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
michael@gmail.com To: cocoa-dev cocoa-dev@lists.apple.com Sent: Monday, April 27, 2009 9:57:33 PM Subject: Re: Why is NSString-FSRef so hard? On Tue, Apr 28, 2009 at 12:51 AM, Erg Consultant erg_consult...@yahoo.com wrote: So why isn't it working? Why does LSOpenApplication give me an error

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Ken Thomases
On Apr 27, 2009, at 11:51 PM, Erg Consultant wrote: 4) I verified that the file I am trying to open using LSOpenApplication exists at the path the URL points to when it gets converted to an FSRef. So why isn't it working? Why does LSOpenApplication give me an error? What is the

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
NSString-CFURL-FSRef. Erg From: Michael Ash michael@gmail.com To: cocoa-dev cocoa-dev@lists.apple.com Sent: Monday, April 27, 2009 9:51:14 PM Subject: Re: Why is NSString-FSRef so hard? On Tue, Apr 28, 2009 at 12:26 AM, Erg Consultant erg_consult...@yahoo.com

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
, 2009 10:11:43 PM Subject: Re: Why is NSString-FSRef so hard? On Apr 27, 2009, at 11:51 PM, Erg Consultant wrote: 4) I verified that the file I am trying to open using LSOpenApplication exists at the path the URL points to when it gets converted to an FSRef. So why isn't it working? Why

Re: Why is NSString-FSRef so hard?

2009-04-27 Thread Erg Consultant
: Saturday, April 25, 2009 6:12:33 PM Subject: Re: Why is NSString-FSRef so hard? On Apr 25, 2009, at 8:03 PM, Erg Consultant wrote: On Apr 25, 2009, at 7:48 PM, Stephen J. Butler wrote: On Sat, Apr 25, 2009 at 7:28 PM, Erg Consultant erg_consult...@yahoo.com wrote: I was using CFURLGetFSRef

Re: Why is NSString-FSRef so hard?

2009-04-26 Thread Sean McBride
Erg Consultant (erg_consult...@yahoo.com) on 2009-04-25 7:33 PM said: Isn't there some easy way to get an FSRef from an NSString that is a path containing special characters? You can use NDAlias: http://github.com/nathanday/ndalias/tree/master It provides an NSString category that converts

Why is NSString-FSRef so hard?

2009-04-25 Thread Erg Consultant
I am trying to convert an NSString containing a path to a file directly to an FSRef. If there are no special characters in the path, it's easy - I can go from NSString to CFURL to FSRef. But if the path contains any special characters at all, both CFURL and NSURL creation routines fail. No

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Nick Zitzmann
On Apr 25, 2009, at 5:33 PM, Erg Consultant wrote: Isn't there some easy way to get an FSRef from an NSString that is a path containing special characters? What, specifically, have you tried? I don't think I've ever had +fileURLWithPath: fail on me with a path string, even if the string

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Michael Ash
On Sat, Apr 25, 2009 at 7:33 PM, Erg Consultant erg_consult...@yahoo.com wrote: I am trying to convert an NSString containing a path to a file directly to an FSRef. If there are no special characters in the path, it's easy - I can go from NSString to CFURL to FSRef. But if the path contains

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Stephen J. Butler
On Sat, Apr 25, 2009 at 6:33 PM, Erg Consultant erg_consult...@yahoo.com wrote: I am trying to convert an NSString containing a path to a file directly to an FSRef. If there are no special characters in the path, it's easy - I can go from NSString to CFURL to FSRef. But if the path contains

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Erg Consultant
@lists.apple.com Sent: Saturday, April 25, 2009 4:41:20 PM Subject: Re: Why is NSString-FSRef so hard? On Apr 25, 2009, at 5:33 PM, Erg Consultant wrote: Isn't there some easy way to get an FSRef from an NSString that is a path containing special characters? What, specifically, have you tried? I

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Stephen J. Butler
On Sat, Apr 25, 2009 at 7:28 PM, Erg Consultant erg_consult...@yahoo.com wrote: I was using CFURLGetFSRef passing in the NSString which works fine as long as the path contains no special chars. If it does, CFURLGetFSRef returns nil. CFURLGetFSRef is great if what you have originally is a

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Erg Consultant
: Why is NSString-FSRef so hard? On Sat, Apr 25, 2009 at 7:28 PM, Erg Consultant erg_consult...@yahoo.com wrote: I was using CFURLGetFSRef passing in the NSString which works fine as long as the path contains no special chars. If it does, CFURLGetFSRef returns nil. CFURLGetFSRef is great if what

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Steve Christensen
, 2009 4:41:20 PM Subject: Re: Why is NSString-FSRef so hard? On Apr 25, 2009, at 5:33 PM, Erg Consultant wrote: Isn't there some easy way to get an FSRef from an NSString that is a path containing special characters? What, specifically, have you tried? I don't think I've ever had

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Ken Thomases
On Apr 25, 2009, at 7:28 PM, Erg Consultant wrote: I was using CFURLGetFSRef passing in the NSString which works fine as long as the path contains no special chars. If it does, CFURLGetFSRef returns nil. File path strings aren't URLs. Even a string which looks a bit URL- ish (for

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Michael Ash
On Sat, Apr 25, 2009 at 8:28 PM, Erg Consultant erg_consult...@yahoo.com wrote: I was using CFURLGetFSRef passing in the NSString which works fine as long as the path contains no special chars. If it does, CFURLGetFSRef returns nil. That's unlikely. CFURLGetFSRef needs a CFURLRef or NSURL, not

Re: Why is NSString-FSRef so hard?

2009-04-25 Thread Ken Thomases
On Apr 25, 2009, at 8:03 PM, Erg Consultant wrote: On Apr 25, 2009, at 7:48 PM, Stephen J. Butler wrote: On Sat, Apr 25, 2009 at 7:28 PM, Erg Consultant erg_consult...@yahoo.com wrote: I was using CFURLGetFSRef passing in the NSString which works fine as long as the path contains no special