Home » U++ Library support » U++ Core » Sys command truncates captured console output
Sys command truncates captured console output [message #48530] |
Sat, 15 July 2017 12:11  |
 |
deep
Messages: 268 Registered: July 2011 Location: Bangalore
|
Experienced Member |
|
|
Hi
I am running sed script on a 1 Mb file from UPP code using Sys(cmd,output) . Ubuntu 16.04. UPP ver 10205
It captures complete output of sed
Recently I changed to UPP ver 11213
Now my Captured output of Sys("SED command",output); is truncated to 2Kb.
I found following change in "LocalProcess.cpp" from version 10205 to 11213.
Ver 10205 Line 513 while((sv = select(pipe[0]+1, set, NULL, NULL, &tval)) > 0)
Ver 11213 Line 513 if ((sv = select(pipe[0]+1, set, NULL, NULL, &tval)) > 0)
Changed "if" back to "while" is working fine for me.
File Core/LocalProcess.cpp working code
while((sv = select(pipe[0]+1, set, NULL, NULL, &tval)) > 0) {
LLOG("Read() -> select");
char buffer[1024];
int done = read(pipe[0], buffer, sizeof(buffer));
LLOG("Read(), read -> " << done);
if(done > 0)
res[wp].Cat(buffer, done);
else if (done == 0) {
close(pipe[0]);
pipe[0] = -1;
}
}
Warm Regards
Deepak
|
|
|
Goto Forum:
Current Time: Wed May 14 11:06:07 CEST 2025
Total time taken to generate the page: 0.00990 seconds
|