DeepCausality Tempfile
The crate provides scratch files and directories for the DeepCausality test suites. It depends
only on std. It has two types:
TempDiris a new, empty directory understd::env::temp_dir(). Dropping it removes the directory and everything inside it.NamedTempFileis a new, empty file understd::env::temp_dir(). You write to it throughstd::io::Write, and dropping it removes the file.NamedTempFile::with_suffix(".csv")ends the file name with an extension.
use Write;
use ;
let dir = new.unwrap;
write.unwrap;
let mut f = with_suffix.unwrap;
f.write_all.unwrap;
f.flush.unwrap;
assert_eq!;
Creation never opens a path that already exists. On Unix, files are created with mode 0o600 and
directories with mode 0o700, before the umask applies. A suffix that contains / or \ is rejected
with ErrorKind::InvalidInput.