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

Stdin.readLine aborts when reading from a file #29

Open
busterwood opened this issue Jan 3, 2020 · 3 comments
Open

Stdin.readLine aborts when reading from a file #29

busterwood opened this issue Jan 3, 2020 · 3 comments

Comments

@busterwood
Copy link

Using bash to redirect Stdin from a file seems to fail.

Here is the simplest example test1.wren:

import "io" for Stdin, Stdout
var line = Stdin.readLine()
System.print("line: " + line)

When I run interactively it works:

chris@WIN-FE4HG5BFASB:~$ wren/wren test1.wren
fred
line: fred
chris@WIN-FE4HG5BFASB:~$

However, when I redirect stdin to read from a non-empty file it fails:

chris@WIN-FE4HG5BFASB:~$ wren/wren test1.wren < sales.txt
Aborted
chris@WIN-FE4HG5BFASB:~$ head sales.txt
--
-- PostgreSQL database dump
--

-- Dumped from database version 11.5
-- Dumped by pg_dump version 11.5 (Debian 11.5-3.pgdg80+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;

Using Ubuntu on WSL 2 on Windows 10.

@mhermier
Copy link
Contributor

mhermier commented Jan 3, 2020 via email

@ruby0x1 ruby0x1 transferred this issue from wren-lang/wren Jun 6, 2020
@joshgoebel
Copy link
Contributor

joshgoebel commented Apr 30, 2021

Redirections like these

Like which? Are there other redirections that do work?


I'm on Mac OS and both 0.3.0 and latest main work just fine for me when piping or redirecting a file (using provided examples). Is this a Windows or platform specific issue? Or perhaps the UV version has been bumped since this was opened and the behavior I'm seeing is new?

@joshgoebel
Copy link
Contributor

@busterwood Could you confirm if this is still an issue with the latest code in main and let us know which platform you're seeing the issue on?

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

3 participants