CreationDisposition enumv0.1.0

Source
The CreationDisposition values exposed by this package.
pub enum CreationDisposition: uint32 {
    CreateNew = 1,
    CreateAlways = 2,
    OpenExisting = 3,
    OpenAlways = 4,
    TruncateExisting = 5
}

Cases

NameValueDescription
CreateNew1Create the file, and fail with ERROR_FILE_EXISTS if the name is taken.
CreateAlways2Create the file, truncating whatever is there. Succeeds either way, and reports ERROR_ALREADY_EXISTS through GetLastError when it truncated rather than created.
OpenExisting3Open the file, and fail with ERROR_FILE_NOT_FOUND if it is not there.
OpenAlways4Open the file, creating it if it is not there. Reports ERROR_ALREADY_EXISTS when it opened rather than created.
TruncateExisting5Open the file and truncate it, failing if it is not there. Needs write access.