pub fn create_file() -> bool {
    get_key_derivation();
    if get_password(true).is_empty() {
        return false;
    }
    let encrypted = encrypt_text("Dummy Space");

    match fs::create_dir_all(get_file_parent_path()) {
        Ok(_) => {}
        Err(_) => {
            e!("Can't create parent directories.");
            return false;
        }
    }

    match fs::File::create(get_file_path()) {
        Ok(f) => f,
        Err(_) => {
            e!("Error creating the file.");
            return false;
        }
    };

    do_file_write(encrypted);
    true
}
// Attempts to create the file
// It adds a default header as its only initial content
// The content is encrypted using the password
Attempts to create the file
It adds a default header as its only initial content
The content is encrypted using the password
Attempts to create the file It adds a default header as its only initial content The content is encrypted using the password
pub fn create_file() -> bool {
    get_key_derivation();
    if get_password(true).is_empty() {
        return false;
    }
    let encrypted = encrypt_text("Dummy Space");
    match fs::create_dir_all(get_file_parent_path()) {
        Ok(_) => {}
        Err(_) => {
            e!("Can't create parent directories.");
            return false;
        }
    }
    match fs::File::create(get_file_path()) {
        Ok(f) => f,
        Err(_) => {
            e!("Error creating the file.");
            return false;
        }
    };
    do_file_write(encrypted);
    true
}
pub fn create_file ( ) -> bool { get_key_derivation ( ) ; if get_password ( true ) . is_empty ( ) { return false ; } let encrypted = encrypt_text ( " " ) ; match fs :: create_dir_all ( get_file_parent_path ( ) ) { Ok ( _ ) => { } Err ( _ ) => { e ! ( " " ) ; return false ; } } match fs :: File :: create ( get_file_path ( ) ) { Ok ( f ) => f , Err ( _ ) => { e ! ( " " ) ; return false ; } } ; do_file_write ( encrypted ) ; true }
Attempts to create the file
It adds a default header as its only initial content
The content is encrypted using the password
Attempts to create the file It adds a default header as its only initial content The content is encrypted using the password