I have a C program that processes text files. When I run it from the
commandline, it works fine. But if I run it via Ruby with
'system("textproc input output")' that output file usually gets
truncated near its end. The docs state:
"one of the exec(2) system calls is used, so the running command may
inherit some of the environment of the original program (including open
file descriptors)"
Is there some setting for Ruby which could be causing this problem -
such as a memory limit? I don't get any error messages whatsoever. I've
also tried exec() and popen(), with the same results.
When you say "truncated near the end", is that the last line of text
that gets chopped? Last 1 or few characters? Does the C program close
all open file handles, etc.? Also, what platform are you on?