//! touch file... -- create empty files (existing files are left alone; //! there are no timestamps to update yet). #![no_std] #![no_main] extern crate ulib; ulib::entry!(main); use ulib::*; fn main() -> i64 { let mut status = 0; for i in 1..argc() { let path = arg(i).unwrap_or(""); let fd = open(path, O_WRONLY | O_CREAT); // no O_TRUNC: keep the contents if fd < 0 { eprintln!("touch: {}: {}", path, strerror(fd)); status = 1; } else { close(fd); } } status }