I have a problem using alarm from nix library in rust. I am trying to communicate two child process with alarms, the exercise consist in send a signal to child process to other every two seconds, and retun it with pipe. When I run the code it still waiting and I can’t see the message. This is my code: Thanks!!!
I am playing with the following two code snippets What the above code wants to do is to read a byte from the user keyboard and then print it to stdout. The confusing thing is two snippets have different behaviors: I am sorry about the format of the above code, I don’t know how to place the prompt at the
I have a basic rust/cargo project with a single main file and some basic dependencies. The cargo build command works fine when the target is not specified (I am using windows so it builds to windows), but when I try to cross compile the program to linux using cargo build –target=x86_64-unknown-linux-gnu or cargo build –target=x86_64-unknown-linux-musl, the process fails with the
I have an open std::fs::File, and I want to get it’s filename, e.g. as a PathBuf. How do I do that? The simple solution would be to just save the path used in the call to File::open. Unfortunately, this does not work for me. I am trying to write a program that reads log files, and the program that writes
When you use git commit without the -m flag it opens your default editor, which is set by the $EDITOR environment variable. Doing so enables you to edit multiple lines, navigate with the arrows and submit the text when you’re done. I’d like to do something similar with my command line program. It could be opening the default editor or
I want to call ioctl from Rust. I know that I should use the nix crate, but how exactly? From the documentation it’s not clear. I have this C: How would I do that same thing using the nix crate? There are no TUN* constants in the nix crate and it isn’t clear how to use the ioctl macro. Answer