Flush cpost( )?

Oct 6, 2013 at 10:37pm

Flush cpost( )?

Hi,

Is there a way to flush cpost (SDK 5.1.7 / OS X 10.6.8)?

#267290
Oct 7, 2013 at 12:42am

What do you mean by ‘flushing’ cpost? If you mean what I think you mean, this thread might be of interest: http://cycling74.com/forums/topic/object_post-object_error-and-object_warn-without-deferring .

HTH,
Ádám

P.S. BTW, a message to the admins: you should really improve the search tool of the forum, this is so embarrassing. It took me about 10 minutes to find the linked forum thread, even though I knew that it exists (I even knew that it was posted in the dev forum) and I was using the proper keywords.

#267299
Oct 7, 2013 at 1:43am

Hi,

When i use the cpost( ) function (in debugging purpose) some messages are stuck in the pipes. That’s pretty troublesome as i must wait another log or quit Max/MSP to get them properly pushed. Thanks Ádám for the link but in my case AFAIK i didn’t block any thread.

I finally resolved (i guess) my problem with the simple code below.

printf("%s / %s\n", s, strings[i]);
fflush(stdout);

But i still would prefer to use cpost( ) for portability and efficiency (as i don’t want to manually flush every line sent).

#267302
Oct 7, 2013 at 3:57am

Short-lived hapiness : doesn’t work better.

I did a test to illustrate my problem ( https://github.com/nicolasdanet/Flop/blob/master/Sources/Flop/flopBacktrace.c ).

It works fine! Perhaps you were right Ádám.

#267307
Oct 7, 2013 at 7:16am

The yippee! was too fast (it is not reliable at all).

1. Tried with “setmirrortoconsole” without more success.
2. Avoid post and only used cpost. Not better.
3. Replaced by fprintf/stderr ditto.

I give up. Not possible to get debug messages (foolproof) in my console.

#267324
Oct 7, 2013 at 8:43am

Sum up the blah-blah:

Is it possible to publish (from an external) UNBUFFERED strings to stderr/stdout? I conclude that not. Am i wrong?

#267334

You must be logged in to reply to this topic.