• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FSRef_fopen alternative
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: FSRef_fopen alternative
      • From: Jens Ayton <email@hidden>
References: 
 >Re: FSRef_fopen alternative (From: Jonny Taylor <email@hidden>)

  • Prev by Date: Re: Xcode/gcc help in enforcing secure coding?
  • Next by Date: Re: MS Excel 2004 XLL addin in xcode
  • Previous by thread: Re: FSRef_fopen alternative
  • Next by thread: Re: FSRef_fopen alternative
  • Index(es):
    • Date
    • Thread