File Objects

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
{{File}}
{{File}}
-
DaisyMoon contains classes for writing and reading binary files. These can be useful if you want to have creater control over the file structure, as Lua generally only works with strings and doubles in normal cases.
+
DaisyMoon contains classes for writing and reading binary files. These can be useful if you want to have greater control over the file structure, as Lua generally only works with strings and doubles in normal cases.
If you only want to write text to the file, it is recommended that you use the standard IO Lua library instead: [http://lua-users.org/wiki/IoLibraryTutorial Lua IO Tutorial]
If you only want to write text to the file, it is recommended that you use the standard IO Lua library instead: [http://lua-users.org/wiki/IoLibraryTutorial Lua IO Tutorial]

Revision as of 23:24, 7 February 2010

DaisyMoon File Objects

DaisyMoon contains classes for writing and reading binary files. These can be useful if you want to have greater control over the file structure, as Lua generally only works with strings and doubles in normal cases.

If you only want to write text to the file, it is recommended that you use the standard IO Lua library instead: Lua IO Tutorial

Contents

File Modes

The file objects can handle three different modes of writing and reading. This is chosen by giving different settings when creating the file objects.

File on Disk (f)

This is the default behaviour. The data will be written or read from a binary file on disk.

Compressed on Disk (z)

When writing a compressed file, all data will first be written into memory and then compressed (as a zip) before being written to disk. When reading a compressed file, the whole file will be read into memory and then unpacked.

In Memory (m)

You can also use the file objects to serialize things in memory (without writing to disk).

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox