Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-e 'con' returns 0 on Windows causing the debugger to use stdin #235

Open
dowy opened this issue Feb 3, 2025 · 1 comment
Open

-e 'con' returns 0 on Windows causing the debugger to use stdin #235

dowy opened this issue Feb 3, 2025 · 1 comment

Comments

@dowy
Copy link

dowy commented Feb 3, 2025

On Windows, checking for the existence of the special file con returns false but opening it works as expected:

if (-e "con") {
  print qq[yes\n];
} else {
  print qq[no\n];
}
open my $con, '<', 'con' or die qq[Can't open 'con': $!\n];
$_ = <$con>;
print qq[xx $_ xx\n];
"close $con;

produces:

no
hello
xx hello
 xx

This has the effect of causing the Perl debugger (perl5db.pl) to report:
Can't figure out your console, using stdin

Which then means that a debugged program cannot redirect stdin and when an End-of-File is sent to the program while it is reading data from stdin then the debugger terminates and the program and exits.

Can the -e operator return 1 for the Windows special devices like con?

@shawnlaffan
Copy link
Contributor

I can reproduce on 5.36 but not on 5.32.

I wonder if this is to do with the changes made to stat in 5.34? (5.33.5 is the first dev release it is in).
Perl/perl5@92b3a3e

Even if it is not, I suspect this is a perl issue rather than strawberry perl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants