[BinaryFile]|[nil] file = fs.open(path, openmode, compressionType, compressionLevel, compressionHeader)


Opens a memory stream to write data to (you can then write that stream to a file stream using :writeStream)

Parameters


[Optional] path

nil

Leave nil to open a memory stream

[Optional] openmode

string

how to open the file, w is write mode, a is append(and it will add to an existing file or start)

[Optional] compressionType

string

The compression type to use, anything that isn't store or none will have compression enabled

[Optional] compressionLevel

integer

The compression level to use, 0 is terrible compression, 1 is fastest, 6 is balanced, 9 is best compression

[Optional] compressionHeader

boolean

If you want to skip the header, if you do you can't read the file without knowing the compression type

Return Value


file

BinaryFile | nil

The (hopefully) opened stream