Subj : Re: Any rust programmers? To : Apam From : tenser Date : Sat Nov 11 2023 11:08:31 On 10 Nov 2023 at 08:30a, Apam pondered and said... Ap> BY: tenser (21:1/101) Ap> Ap> t> I'm not sure what you mean with respect to redirection and Ap> t> the blocking/buffering behavior of stdin. Can you explain Ap> t> what it is precisely that you're trying to do? Generally, Ap> Ap> On linux, most bbs systems redirect stdin/stdout to the telnet socket. Ap> I'm trying to remove line buffering so i can read characters one at a Ap> time, and stop blocking so i can test for timeleft while waiting for Ap> input. Gotcha. I think what this means at the system level is that IO to the standard in, out, and error streams is redirected to the network, which is independent of the "standard IO" library in a lot of ways. Given that you want to sample from both an input and test against a timeout, you may actually have a good candidate for using `async/await` and tokio; then you'd test between the timeout and input arriving on the socket. Ap> t> library. Indeed, if you need unbuffered/non-blocking Ap> t> semantics for a particular file-like object, stdio may not Ap> t> be the best abstraction. Ap> Ap> I did try from raw fd on fd 0 and 1, while it worked for stdout, it did Ap> not work for stdin. Looks like you found the issue by putting the tty into raw mode. Huzzah! Ap> t> I'm looking at your code: I'd definitely recommend running Ap> t> `rustfmt` to start. Ap> Ap> Cool! thanks for the tip! i imagine that's like clangformat? Yup. `cargo fmt` early and often. --- Mystic BBS v1.12 A48 (Linux/64) * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101) .