system() calls in windows not working for some users

D

dtfcalibrator

I use the following in a program:

system("pause");

and

system("copy $file1 $file2 >nul");

For myself and most users, these lines have no problem.
The first one presents the user with:
"Press any key to continue . . ."
the second is silent and works great.

However, I've figured out one user (running WinXP) is failing on all
system commands.
He never sees "Press any key to continue . . ." and the program dies on
an error when it can't find $file2. Anyone hear of anything like this?
It's strange it's only failing on one computer.

BTW - he's tried manually copying in a DOS window. That works fine.

Thanks.
 
D

dtfcalibrator

Yeah, that's my fail-safe option ... remove all system calls. It'd
just be easier to not have to re-release. Thanks.
 
X

xhoster

I use the following in a program:

system("pause");

and

system("copy $file1 $file2 >nul");

For myself and most users, these lines have no problem.
The first one presents the user with:
"Press any key to continue . . ."
the second is silent and works great.

However, I've figured out one user (running WinXP) is failing on all
system commands.

Have you considered having Perl tell you why it fails?

system("pause") and die "$! $? $^E";
He never sees "Press any key to continue . . ." and the program dies on
an error when it can't find $file2.

That seems unlikely. While it may generate a message to STDERR about not
being able to find $file2, the code you show should not die on that event.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top