Function latin::file::write_lines
[−]
[src]
pub fn write_lines<P: AsRef<Path>, I: IntoIterator<Item = B, IntoIter = A>, A: Iterator<Item = B>, B: AsRef<[u8]>>(
path: P,
lines: I
) -> IoResult<()>
Writes lines into a file at path
.
If the file at path
does not exist, it will be created.
Otherwise, the file will be completely overwritten.
latin::file::write_lines("./foo.txt", vec!["line1", "line2"]); // works with iterators too latin::file::write_lines("./foo.txt", vec!["line1", "line2"].iter().map(|l| &l[0 .. 2]));