pub fn write_num(num: u64, fname: &str) -> std::io::Result<()>
{
    let s: String = num.to_string() + ",\n";
    if Path::new(fname).exists() {
        let mut file = OpenOptions::new().append(true).open(fname)?;
        file.write_all(s.as_bytes())?;
    }
    else {
        let mut file = File::create(fname)?;
        file.write_all(s.as_bytes())?;
    }
    return Ok(());
}
/// Write a number to a given filename
///
/// If the file all ready exists, the number will be appended.
///
/// Each number gets its own line and is comma delimited so one can
/// diff the output of two files more easily as well as import the data
/// into other application.
///
/// Example:
///
/// write_num(1, "foo.txt");
Write a number to a given filename
If the file all ready exists, the number will be appended.

Each number gets its own line and is comma delimited so one can
diff the output of two files more easily as well as import the data
into other application.




Write a number to a given filename If the file all ready exists the number will be appended . Each number gets its own line and is comma delimited so one can diff the output of two files more easily as well as import the data into other application .
pub fn write_num(num: u64, fname: &str) -> std::io::Result<()>
{
    let s: String = num.to_string() + ",\n";
    if Path::new(fname).exists() {
        let mut file = OpenOptions::new().append(true).open(fname)?;
        file.write_all(s.as_bytes())?;
    }
    else {
        let mut file = File::create(fname)?;
        file.write_all(s.as_bytes())?;
    }
    return Ok(());
}
pub fn write_num ( num : u64 , fname : & str ) -> std :: io :: Result < ( ) > { let s : String = num . to_string ( ) + " \n " ; if Path :: new ( fname ) . exists ( ) { let mut file = OpenOptions :: new ( ) . append ( true ) . open ( fname ) ? ; file . write_all ( s . as_bytes ( ) ) ? ; } else { let mut file = File :: create ( fname ) ? ; file . write_all ( s . as_bytes ( ) ) ? ; } return Ok ( ( ) ) ; }
Write a number to a given filename
If the file all ready exists, the number will be appended.
Write a number to a given filename If the file all ready exists the number will be appended .
num
u64
fname
&str
num
u64
fname
&str