On 10 nov 2008, at 07.16, Marcus wrote:


9 nov 2008 kl. 23.03 skrev Tommy Nordgren:

Is it possible to open an Additional file for use by logging in Cocoa
(I want it to contain ONLY the info logged from my App)

You can do that by just redirect standard error to a file. Since each process has their own set of file descriptors it will only affect your application.

int fd = creat ("/Users/marcus/my_log", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
close (STDERR_FILENO);
dup (fd);
close (fd);
NSLog(@"this will be written to my_log");

Marcus


The specified method don't work. The default console log don't get a copy this way. A similar methods works if I forks, and pipes standard error into the tee command. I had really hoped there would be a method to set up the standard error fd to
echo it's data to multiple file descriptors in my process.

----------------------------------
Skinheads are so tired of immigration, that they are going to move to a country that don't accept immigrants!
Tommy Nordgren
[EMAIL PROTECTED]



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to