> Maybe you could provide an example of exactly what is failing; I cannot 
> reproduce this behaviour from my understanding of your question.

I tried to reduce the script to an example anyone could test. After long 
attempts I had to figure out that it wasn't Ruby's fault. Sorry for 
accusing it.

All my script does, is assembling a command line for the program to 
call. What I did not know, is that this program can only take parameters 
up to 215 chars long. The Ruby lines I commented out were (later on in 
the script) responsible for a difference of only a few characters. So it 
appeared that everything worked without those lines and that with those 
lines, the external program crashed with "Destination buffer too small 
(CopyString)".

Martin