Import std.io.file_stream
OpenOptions
struct
Public Struct OpenOptions
How File.Open opens a file: to read, to write, or both, and, for one it writes, whether each write goes at its end, whether it's made when it isn't there, or only then, and whether what it held is gone first.
Examples
Local file = Try TempFile()
Try File.WriteText(file.Path, "start")
Local options = OpenOptions()
options.Write = True
options.Append = True
Local stream = Try File.Open(file.Path, options)
Try stream.WriteText(", then more")
stream.Close()
Expect((Try File.ReadText(file.Path)) == "start, then more")
Try file.Close()std/io/file_stream.fb, line 53
-
Whether it reads the file.
-
Whether it writes the file.
-
Each write goes at the file's end, wherever the stream is, which is a write too.
-
The file is made, empty, when it isn't there.
-
The file is made, and one that's there is an IOError of ALREADY_EXISTS.
-
What the file held is gone once it's open.
Report an issue with this page or with FutureBlitz on GitHub.