* [Cocci] coccilib.report.print_report Broken For Redirected STDOUT
@ 2017-02-11 19:13 Michael Stefaniuc
2017-02-11 19:20 ` Julia Lawall
0 siblings, 1 reply; 4+ messages in thread
From: Michael Stefaniuc @ 2017-02-11 19:13 UTC (permalink / raw)
To: cocci
Hello!
coccilib.report.print_report is not producing any output when STDOUT is
redirected to a file or a pipe. I have attached a simple test case.
spatch cocciprint.cocci cocciprint.c
cocciprint.c:3:8-9: Printing Suceeded
spatch cocciprint.cocci cocciprint.c > /tmp/nothing
wc -c /tmp/nothing
0 /tmp/nothing
thanks
bye
michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cocciprint.c
Type: text/x-csrc
Size: 42 bytes
Desc: not available
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20170211/5020f4c4/attachment.bin>
-------------- next part --------------
@r@
identifier i;
position p;
@@
int i at p;
@ script:python @
p << r.p;
@@
coccilib.report.print_report(p[0], "Printing Suceeded")
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cocci] coccilib.report.print_report Broken For Redirected STDOUT
2017-02-11 19:13 [Cocci] coccilib.report.print_report Broken For Redirected STDOUT Michael Stefaniuc
@ 2017-02-11 19:20 ` Julia Lawall
2017-02-12 0:23 ` Thierry Martinez
0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2017-02-11 19:20 UTC (permalink / raw)
To: cocci
On Sat, 11 Feb 2017, Michael Stefaniuc wrote:
> Hello!
>
> coccilib.report.print_report is not producing any output when STDOUT is
> redirected to a file or a pipe. I have attached a simple test case.
>
> spatch cocciprint.cocci cocciprint.c
> cocciprint.c:3:8-9: Printing Suceeded
>
> spatch cocciprint.cocci cocciprint.c > /tmp/nothing
> wc -c /tmp/nothing
> 0 /tmp/nothing
Thanks for the report. Will have it looked into.
julia
>
>
> thanks
> bye
> michael
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cocci] coccilib.report.print_report Broken For Redirected STDOUT
2017-02-11 19:20 ` Julia Lawall
@ 2017-02-12 0:23 ` Thierry Martinez
2017-02-13 9:47 ` Michael Stefaniuc
0 siblings, 1 reply; 4+ messages in thread
From: Thierry Martinez @ 2017-02-12 0:23 UTC (permalink / raw)
To: cocci
Hello!
Michael:
>> spatch cocciprint.cocci cocciprint.c > /tmp/nothing
>> wc -c /tmp/nothing
>> 0 /tmp/nothing
Standard output gets buffered when redirected to a file and not flushed
as quickly as it is when there is no redirection: it is not specific to
coccilib.report.print_report and the same observation can be obtained
by just calling "print".
I just committed a simple fix on GitHub: standard outputs are now
flushed at the end of the processing of code transformation.
Thanks for the report. Best regards.
--
Thierry.
Julia Lawall (2017/02/11, 19:20 UTC)?:
> On Sat, 11 Feb 2017, Michael Stefaniuc wrote:
>
>> Hello!
>>
>> coccilib.report.print_report is not producing any output when STDOUT is
>> redirected to a file or a pipe. I have attached a simple test case.
>>
>> spatch cocciprint.cocci cocciprint.c
>> cocciprint.c:3:8-9: Printing Suceeded
>>
>> spatch cocciprint.cocci cocciprint.c > /tmp/nothing
>> wc -c /tmp/nothing
>> 0 /tmp/nothing
>
> Thanks for the report. Will have it looked into.
>
> julia
>
>>
>>
>> thanks
>> bye
>> michael
>>
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cocci] coccilib.report.print_report Broken For Redirected STDOUT
2017-02-12 0:23 ` Thierry Martinez
@ 2017-02-13 9:47 ` Michael Stefaniuc
0 siblings, 0 replies; 4+ messages in thread
From: Michael Stefaniuc @ 2017-02-13 9:47 UTC (permalink / raw)
To: cocci
On 02/12/2017 01:23 AM, Thierry Martinez wrote:
> Hello!
>
> Michael:
>>> spatch cocciprint.cocci cocciprint.c > /tmp/nothing
>>> wc -c /tmp/nothing
>>> 0 /tmp/nothing
>
> Standard output gets buffered when redirected to a file and not flushed
> as quickly as it is when there is no redirection: it is not specific to
> coccilib.report.print_report and the same observation can be obtained
> by just calling "print".
>
> I just committed a simple fix on GitHub: standard outputs are now
> flushed at the end of the processing of code transformation.
Thanks Thierry, that fixes the issue.
bye
michael
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-13 9:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-11 19:13 [Cocci] coccilib.report.print_report Broken For Redirected STDOUT Michael Stefaniuc
2017-02-11 19:20 ` Julia Lawall
2017-02-12 0:23 ` Thierry Martinez
2017-02-13 9:47 ` Michael Stefaniuc
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.