• 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: stdout or stderr file path on iPhone?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdout or stderr file path on iPhone?


  • Subject: Re: stdout or stderr file path on iPhone?
  • From: Manfred Schwind <email@hidden>
  • Date: Tue, 30 Aug 2011 23:36:35 +0200

>>> Background: I have a third party library (that I am not allowed to change) that logs to a file in Debug mode. I want to see this log output directly in the Xcode console, because transferring log files from the iPhone is too complicated. The library provides an API to set the file path (unfortunately not a file handle or something else).
>
> Is there any way that could find the file descriptor for that log file, close it, fdup it to 3 (stderr)???

Great, thanx! That works like a charm.
Access to the file descriptor is exposed through some preprocessor macros in the header of the library.
So now I just grab this file descriptor and do a dup2(STDERR_FILENO, fileDescriptor);
Problem solved.

Thank you,
Mani
--
http://mani.de - friendly software

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

References: 
 >stdout or stderr file path on iPhone? (From: Manfred Schwind <email@hidden>)
 >Re: stdout or stderr file path on iPhone? (From: Jens Alfke <email@hidden>)
 >Re: stdout or stderr file path on iPhone? (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Won't Applescript command use defined ivars?
  • Next by Date: Re: Large over 100K pixel high ruler scroll view
  • Previous by thread: Re: stdout or stderr file path on iPhone?
  • Next by thread: Won't Applescript command use defined ivars?
  • Index(es):
    • Date
    • Thread