Re: FSRef_fopen alternative
Re: FSRef_fopen alternative
- Subject: Re: FSRef_fopen alternative
- From: "Edward K. Chew" <email@hidden>
- Date: Tue, 15 Aug 2006 09:51:12 -0400
On 15-Aug-06, at 4:22 AM, Jonny Taylor wrote:
I came across a section in my code where I call
FSRef_fopen(),
Use FSRefMakePath and pass the path to fopen.
Well, that sounds like a straightforward way to go,
but is it
bullet-proof?
No, it isn't. However, fopen() is a path-based API;
if you want to use
fopen() and related APIs, that's the cost. This is
what happens when you
switch the underpinnings of an OS to modern
super-duper robust Unix. :-/
Bulletproof it may not be, but that's exactly what CW
does. If you still have the MSL sources around
somewhere you can find the implementation of functions
such as this in the file FSp_fopen.c.
Really? I just looked at my version of FSp_fopen.c (from CW10). It
seems to call FSOpenFork() and then passes that down to a
__handle_open() function which presumably incorporates the refnum
into a FILE*. Unless the path look-up is taking place somewhere deep
within __handle_open() (I didn't look that far), it seems to me CW
was calling the approved, safe Carbon APIs.
-Ted
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden