• 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: fopen() works only in debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fopen() works only in debugger


  • Subject: Re: fopen() works only in debugger
  • From: John Stiles <email@hidden>
  • Date: Sun, 04 Mar 2007 19:36:00 -0800

When running under the debugger, the max-open-files limit is increased for some reason. You can increase the limit yourself with the BSD call "setrlimit" and RLIMIT_NOFILE.
AFAICS there is no penalty to your app for increasing it to the maximum value. I think it is just there so that runaway processes die sooner.


For more info, /man setrlimit

/
Timothy Larkin wrote:

On Mar 3, 2007, at 10:02 PM, John C. Randolph wrote:


On Mar 3, 2007, at 2:16 PM, Timothy Larkin wrote:

I am working on a Foundation tool which calls fopen() from a class method. It runs correctly under the debugger.

Sounds like your code depends in some way on the current working directory. Also, why are you using fopen() instead of -dataWithContentsOfURL: or -stringWithContentsOfURL:?

Thanks for your response.

The path to fopen is absolute, and I am opening it for writing. I don't see how this can be affected by the working directory.

I am using fprintf instead of accumulating a string and writing it all at once because hundreds of writers are distributed throughout the program tree, and each is asked to write thousands of times. It seemed that having them write through a shared file stream would be quicker than mutating a string a hundreds of thousands of times.

--
Timothy Larkin
Abstract Tools
Caroline, NY

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: fopen() works only in debugger
      • From: Darkshadow <email@hidden>
References: 
 >fopen() works only in debugger (From: Timothy Larkin <email@hidden>)
 >Re: fopen() works only in debugger (From: "John C. Randolph" <email@hidden>)
 >Re: fopen() works only in debugger (From: Timothy Larkin <email@hidden>)

  • Prev by Date: Re: rotating an object around the center of a view
  • Next by Date: Problem with NSArchiver in document-based application
  • Previous by thread: Re: fopen() works only in debugger
  • Next by thread: Re: fopen() works only in debugger
  • Index(es):
    • Date
    • Thread