Problem making system call on Win98.. help!



this is driving me crazy. i worked on it for hours and cant figure it out.

i have an execuatable program, written in C, that prints its result as a string
to the terminal. and this program definitely works correctly on WinXP or
Win98. it prints the result to the screen. big deal, right?

when i call this executable from Perl, on my WinXP system, and assign its
resulting output to a variable, it works great. i'm able to parse the result
for the values im looking for.

but when i call this executable from Perl on a Win98 system, it will not assign
the resulting output at all. it wont even print it to the screen.

ive tried a number of methods:

$result=system("myprogram.exe $arguments");
print " found: [$result]\n";

or

$result=`myprogram.exe $arguments`;
print " found: [$result]\n";

or even

$pid = open (FH, "myprogram.exe $arguments |")
or die "couldn't fork! $!\n";
while (1) {
$result = (<FH>);
if ($result) {
print " found: [$result]\n";
last;
}
}
close FH;

all of these 3 methods work correctly on WinXP, but none of them work on Win98.


on Win98 the first (system) method returns zero (0) signifying (i assume) that
the program executed successfully. the second (backtick) method, on Win98,
returns nothing. just a blank. the third method (filehandle pipe), on Win98,
just hangs forever in the while loop.

i even went into the C program, and added some code to *write the output to a
text file*. i recompiled the C program, and when i run the program alone, on
*either* WinXP or Win98, it works correctly. it prints its output to the
screen *and* writes the same output to a text file.

BUT... when i run any one of the above perl scripts to call this executable
within Perl, it does NOT work on Win98. it will NEITHER find the output NOR
write the text file.

of course, if i run any of the perl scripts on WinXP, it will both find the
output, assign it to the perl variable $result, and the proper textfile will be
written.

needless to say, this is driving me ABSOLUTELY NUTS! :-P

my perl program and the compiled executables are the same programs. i dont
have different programs being called here. they are the exact same files,
pulled from a networked drive.

can someone help me please?

thanks

robert





__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.



Relevant Pages

  • Re: is that possible to run winXP with win98???
    ... I would like to setup a page to choose loading Win98 or XP. ... My WinXP drive had set as primary master and win98 as primary slave. ... Install Windows 98 after XP is Installed. ... The simplest way I've found to dual boot between Win9x/Me and WinXP would be to partition your driveroughly as follows: ...
    (microsoft.public.windowsxp.general)
  • Set a custom page size
    ... A network with either Win98 and WinXP machines, ... works with the printer driver, so it's values depends directly on the ... on the remote machine, it means, it uses the remote drivers. ...
    (microsoft.public.vb.winapi)
  • Re: Data loss: problem with copying files from Win98 to XP (FAT32) and vice-versa
    ... After some time I've "discovered" unused 20 GB on that disk so I've formatted it in WinXP. ... in Win98 I couldn't see the files that I copied on that disk in WinXP. ... Because then I closed Win98 and started up WinXP I couldn't see any folder on the disk from XP. ...
    (microsoft.public.windowsxp.general)
  • Data loss: problem with copying files from Win98 to XP (FAT32) and vice-versa
    ... After some time I've "discovered" unused 20 GB on that disk so I've ... Win98 I couldn't see the files that I copied on that disk in WinXP. ... I moved only one folder. ...
    (microsoft.public.windowsxp.general)
  • Re: Data loss: problem with copying files from Win98 to XP (FAT32) and vice-versa
    ... After some time I've "discovered" unused 20 GB on that disk so I've formatted it in WinXP. ... in Win98 I couldn't see the files that I copied on that disk in WinXP. ... Because then I closed Win98 and started up WinXP I couldn't see any folder on the disk from XP. ...
    (microsoft.public.windowsxp.general)