diff --git a/std/os/file.jule b/std/os/file.jule index 6a7c8368a..5356eb30b 100644 --- a/std/os/file.jule +++ b/std/os/file.jule @@ -13,31 +13,21 @@ enum Seek: int { End: 2, // Seek relative to the end } -// Enum wrapper for type-safe o-flags. -enum oFlag: int { - Rdonly: sys::O_RDONLY, - Wronly: sys::O_WRONLY, - Rdwr: sys::O_RDWR, - Append: sys::O_APPEND, - Create: sys::O_CREAT, - Excl: sys::O_EXCL, - Sync: sys::O_SYNC, - Trunc: sys::O_TRUNC, -} - // Flags to open wrapping those of the underlying system. // Not all flags may be implemented on a given system. // Exactly one of O_RDONLY, O_WRONLY, or O_RDWR must be specified. // // All flags have the underlying enum type for type safety. -const O_RDONLY = oFlag.Rdonly // Open the file read-only -const O_WRONLY = oFlag.Wronly // Open the file write-only -const O_RDWR = oFlag.Rdwr // Open the file read-write -const O_APPEND = oFlag.Append // Append data to the file when writing -const O_CREATE = oFlag.Create // Create a new file if none exists -const O_EXCL = oFlag.Excl // Used with O_CREATE, file must not exist -const O_SYNC = oFlag.Sync // Open for synchronous I/O -const O_TRUNC = oFlag.Trunc // Truncate regular writable file when opened +type oFlag: int + +const O_RDONLY = sys::O_RDONLY // Open the file read-only +const O_WRONLY = sys::O_WRONLY // Open the file write-only +const O_RDWR = sys::O_RDWR // Open the file read-write +const O_APPEND = sys::O_APPEND // Append data to the file when writing +const O_CREATE = sys::O_CREAT // Create a new file if none exists +const O_EXCL = sys::O_EXCL // Used with O_CREATE, file must not exist +const O_SYNC = sys::O_SYNC // Open for synchronous I/O +const O_TRUNC = sys::O_TRUNC // Truncate regular writable file when opened // The file stream handle. //