Device Monitoring Studio - Monitor, log and analyze data coming through PC ports and connections
Download Device Monitoring Studio Hide this button

File.OpenMode Enumeration

File opening mode constants. See IFileManager.createFile for more information.

SymbolValueDescription
CreateNew1Creates a new file, only if it does not already exist. If the specified file exists, the function fails with “File Exists” exception. If the specified file does not exist and is a valid path to a writable location, a new file is created.
CreateAlways2Creates a new file, always. If the specified file exists and is writable, the function overwrites the file. If the specified file does not exist and is a valid path, a new file is created.
OpenExisting3Opens a file or device, only if it exists. If the specified file does not exist, the function fails with “File Not Found” exception.
OpenAlways4Opens a file, always. If the specified file does not exist and is a valid path to a writable location, the function creates a file.
TruncateExisting5Opens a file and truncates it so that its size is zero bytes, only if it exists. If the specified file does not exist, the function fails with “File Not Found” exception. The caller must open the file with the File.Access.Write access specifier.