Adopting Swift File Options
Migrate existing C code to Swift, using the file-operation options provided by the System module.
Overview
The C options for how to open a file map to Swift as follows:
The C constants for specifying options when opening a file map to Swift as follows:
O_NONBLOCK⟶ nonBlockingO_APPEND⟶ appendO_CREAT⟶ createO_TRUNC⟶ truncateO_EXCL⟶ exclusiveCreateO_SHLOCK⟶ sharedLockO_EXLOCK⟶ exclusiveLockO_NOFOLLOW⟶ noFollowO_SYMLINK⟶ symlinkO_EVTONLY⟶ eventOnlyO_CLOEXEC⟶ closeOnExec
The C constants for specify seek offsets map to Swift as follows: