make reading from stdout and stderr simultaneously work.

Needs a few test-cases - but seems ok...
This commit is contained in:
Bernhard Amann 2013-03-16 09:54:48 -07:00
parent 3aeec7ec14
commit 6fef99ee03
4 changed files with 274 additions and 26 deletions

View file

@ -0,0 +1,148 @@
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
..:
F
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
bro
F
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
executestreamrawstderr.bro
F
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
out
F
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
ls: ../nonexistant: No such file or directory
T
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
ls: ../nonexistant2: No such file or directory
T
[source=ls .. ../nonexistant ../nonexistant2 ../nonexistant3 |, reader=Input::READER_RAW, mode=Input::MANUAL, name=input, fields=<no value description>, want_record=F, ev=line
{
print A::outfile, A::description;
print A::outfile, A::tpe;
print A::outfile, A::s;
print A::outfile, A::is_stderr;
A::try = A::try + 1;
if (7 == A::try)
{
print A::outfile, done;
close(A::outfile);
Input::remove(input);
terminate();
}
}, config={
[read_stderr] = 1
}]
Input::EVENT_NEW
ls: ../nonexistant3: No such file or directory
T
done