Value | Meaning |
---|---|
read1 << 0 | Open in read mode. |
update1 << 1 | Open in write mode, dont' truncate. Create a file if existingOnly flag is not provided. |
truncate1 << 2 | Open in write mode, truncate if exists. Create a file if existingOnly flag is not provided. |
append1 << 3 | Open in write mode. Append to the end on writing. Create a file if existingOnly flag is not provided. Note that it has a special meaning on Posix: the file opened in append mode will have write operations happening at the end of the file regardless of manual seek position changing. |
createNew1 << 4 | Open in write mode. Create file only if it does not exist, error otherwise. The check for existence and the file creation is an atomical operation. Use this flag when need to ensure that the file with such name did not exist. |
existingOnly1 << 5 | Don't create file if it does not exist when opening in write mode. This flag is not necessary when opening a file in read-only mode. This flag can't be used together with OpenMode.createNew flag. |
Flags for file open mode.