method to_file file_name =
    let channel = open_out file_name in
    Marshal.to_channel channel self flags;
    close_out channel