FileFlags

Description

[Flags]
enum Tinman.Core.IO.Files.FileFlags

Enumeration of behaviour flags for files in a filesystem.

Exactly one of these flags must be specified:

Any of these flags can be specified in addition to the above creation flag:

Public / Constants

Read

public constant Read → (0:int32)

Open an existing file in read-only mode or fail with IOError.NotFound.

Write

public constant Write → (1:int32)

Open an existing file in read-write mode or fail with IOError.NotFound.

Update

public constant Update → (2:int32)

Open an existing file in read-write mode or create a new file.

Create

public constant Create → (3:int32)

Create a new file, overwriting any existing one.

Temporary

public constant Temporary → (4:int32)

Create a new temporary file, overwriting any existing one.

Temporary files are deleted automatically when closed.

MaskCreation

public constant MaskCreation → (7:int32)

Bitmask for file flags that determine the creation disposition for the file.

The following flags fall within this bitmask:

  • Read: open existing (read-only)

  • Write: open existing (read-write)

  • Update: open existing (read-write) or create new

  • Create: create new (persistent)

  • Temporary: create new (temporary)

Sequential

public constant Sequential → (8:int32)

The file is accessed mostly sequentially.

When this flag is not present, file access is assumed to be random.

This is a hint for the underlying filesystem implementation to improve performance. It does not have any functional implications.

NoShare

public constant NoShare → (16:int32)

Prohibits the file from being opened again, for example by other processes.

When opening the same file twice using the file flags A and B, a IOError.SharingViolation error will occur in these cases:

  • If NoShare is present in A and/or B.

  • If both A and B use a creation flag other than Read.

All

public constant All → (31:int32)

All flags.