Mail Archives: djgpp/2003/08/13/03:40:35
[Please keep this discussion on the mailing list, so others could
chime in and help.]
> Date: Wed, 13 Aug 2003 09:23:06 +0200 (CEST)
> From: =?iso-8859-1?q?cyril=20cayla?= <cyrilcayla AT yahoo DOT fr>
>
> I can run some C programs compiled by djgpp called by
> the function "system" in perl. My problem is then
> specific to the program i've created.
Yes.
> I have to find why this prog.exe run perfectly in DOS
> and not in from the Perl code. The answer might be in
> this question: is there any problem with variables
> with very long names in parameter?
> [...]
> the exact call is this:
> system("prog \"".$workdir.$tiflist[$i+1]."\"
> \"".$workdir.$tiflist[$i]."\"
> \"".$workdir.$preprocess[1]."\"
> \"".$workdir.$preprocess[2]."\"
> \"".$workdir.$datfile."\" $pr $spotsize
> $imageanalysistype $offsetadjust $controlimage
> \"".$workdir.$jpgfile."\" 2>\"".$workdir."im.res\"");
This is a very long command line. When non-DJGPP programs invoke
DJGPP programs, they cannot pass commands longer than 126 characters
to them. So to make this work, you need to use the response-file
method of passing long command lines to DJGPP programs. That is,
change your Perl script to write the command-line arguments (what
follows "prog.exe" in your current script) to a file, and then invoke
your program like this:
system("prog.exe @file 2>\"".$workdir."im.res\");
where `file' is the name of the file where you put the rest of the
command line.
- Raw text -