Skip to content
Snippets Groups Projects
Commit 1eff7c7e authored by Jeremy Soller's avatar Jeremy Soller
Browse files

WIP: Simple way to fill file with data

parent 39707bcf
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,24 @@ fn shell<E: Display>(mut fs: FileSystem<E>){
println!("cd <path>");
}
},
"ed" => {
if let Some(arg) = args.next() {
let mut data = String::new();
loop {
let mut line = String::new();
stdin.read_line(&mut line).unwrap();
if line.is_empty() || line == ".\n" {
break;
} else {
data.push_str(&line);
}
}
println!("{}:\n{}", arg, data);
} else {
println!("ed <path>");
}
},
"find" => {
if let Some(arg) = args.next() {
match fs.find_node(arg, block) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment