Luna::FileCreationMode

enum FileCreationMode : u32
{
    create_always= 1
    create_new= 2
    open_always= 3
    open_existing= 4
    open_existing_as_new= 5
}

Specifies file creation mmode.

Options

  • create_always

    Always creates a new file and opens it. If the file already exists, the old file content will be discarded and the file is treated as a new empty file.

  • create_new

    Only creates a file and opens it when it does not exist. If the file already exists, the call fails with BasicError::already_exists.

  • open_always

    Always opens a file. If the file already exists, the file will be open with its data preserved, if the file does not exist, it will be created and opened.

  • open_existing

    Only opens a file when it does exists. If the file does not exist, the call fails with BasicError::not_found.

  • open_existing_as_new

    Only opens a file when it does exists, and discards the file data so the file is treated as a new file.