Use stdio instead of opening the slave manually
This commit is contained in:
parent
feac63c100
commit
4844301a08
10
src/main.rs
10
src/main.rs
@ -1,12 +1,8 @@
|
||||
use std::{fs::File, io::{BufRead, BufReader}};
|
||||
use std::io::Write;
|
||||
use std::io;
|
||||
|
||||
fn main() {
|
||||
let pts_read = File::open("/dev/pts0").unwrap();
|
||||
let mut pts_write = File::open("/dev/pts0").unwrap();
|
||||
|
||||
for line in BufReader::new(pts_read).lines() {
|
||||
for line in io::stdin().lines() {
|
||||
let line = line.unwrap();
|
||||
writeln!(pts_write, "Got line on PTS: {:?}", line).unwrap();
|
||||
println!("Got line on PTS: {:?}", line);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user