trait WriteModeTrait

Selects what to do if the file already exists. The default for this union is add.



Your intent when writing a file to some path. This is used to determine what constitutes a conflict and what the autorename strategy is.

In some situations, the conflict behavior is identical:

  1. If the target path doesn't contain anything, the file is always written; no conflict.
  2. If the target path contains a folder, it's always a conflict.
  3. If the target path contains a file with identical contents, nothing gets written; no conflict

The conflict checking differs in the case where there's a file at the target path with contents different from the contents you're trying to write

Methods

setWriteMode( WriteMode $set)

Selects what to do if the file already exists. The default for this union is add.

Details

at line line 52
WriteModeTrait setWriteMode( WriteMode $set)

Selects what to do if the file already exists. The default for this union is add.



Your intent when writing a file to some path. This is used to determine what constitutes a conflict and what the autorename strategy is.

In some situations, the conflict behavior is identical:

  1. If the target path doesn't contain anything, the file is always written; no conflict.
  2. If the target path contains a folder, it's always a conflict.
  3. If the target path contains a file with identical contents, nothing gets written; no conflict

The conflict checking differs in the case where there's a file at the target path with contents different from the contents you're trying to write

Parameters

WriteMode $set The write mode

Return Value

WriteModeTrait