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

dos.read/write seems to be buffered #126

Open
wepl opened this issue Jan 21, 2020 · 4 comments
Open

dos.read/write seems to be buffered #126

wepl opened this issue Jan 21, 2020 · 4 comments
Labels

Comments

@wepl
Copy link

wepl commented Jan 21, 2020

Reading from stdin via dos.Read doesn't work as expected.
A read of 10 bytes should block until Return is pressed (newline). Instead it blocks until at least 10 bytes are inserted.
Also dos.Write seems to buffer to stdout. Also newline doesn't flush.
Testcode:

#include <stdio.h>
int main() {
        char buf[100];
        int s;
        do {
                s = read(0,buf,10);
                buf[s] = 0;
                printf("l=%ld '%s'\n",s,buf);
        } while (buf[0] != 3);
}

At would also very appreciated if dos.SetMode could be implemented to switch a terminal to raw mode.

@cnvogelg
Copy link
Owner

I see your point. This type of handling requires to model some "handler-like" interface in vamos and an implementation for a console handler. I have this topic on my todo list and I keep the ticket around until its done.

@wepl
Copy link
Author

wepl commented Mar 6, 2020

BTW, I have the impression that this was different in older releases of vamos. Maybe it changed with the migration to Python3?
At least it is very annoying because you won't get continuesly output from any commands executed directly by vamos.

@cnvogelg
Copy link
Owner

cnvogelg commented Mar 9, 2020

indeed, buffering output fixed in a1bd072.
correct read handling needs more work...

@wepl
Copy link
Author

wepl commented Mar 10, 2020

Much better now, thanks.

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

No branches or pull requests

2 participants