#buffer #linux #kernel #port #data #write #library

ttyecho

ttyecho is a crate that lets you write data a into Linux kernel pseudoterminal buffer

3 releases

✓ Uses Rust 2018 edition

new 0.1.2 Aug 13, 2019
0.1.1 Aug 13, 2019
0.1.0 Aug 11, 2019

MIT license

3KB


lib.rs:

ttyecho is a crate that lets you write data into a Linux kernel pseudoterminal buffer. This crate will not work on a non-Linux platform.

Example

fn main() {
    // You can put whatever you want, not only commands.
    let command = "echo ttyecho!";
    // Target tty 
    let tty = "/dev/pts/27";
    // We want to append new line as we want to run echo without user interaction.
    let append_new_line = true;
    
    ttyecho(tty, command, append_new_line);
}

Dependencies

~208KB