Represents the contents of a file. You can obtain an instance of this class using
Internally this class stores raw data (a byte array). It can be passed around as is, for example this will copy a file:
SET CONTENTS TO OPEN("filename"):READALL. SET NEWFILE TO CREATE("newfile"). NEWFILE:WRITE(CONTENTS).
You can parse the contents to read them as a string:
SET CONTENTS_AS_STRING TO OPEN("filename"):READALL:STRING. // do something with a string: PRINT CONTENTS_AS_STRING:CONTAINS("test").
Instances of this class can be iterated over. In each iteration step a single line of the file will be read.
¶ Suffix Type Description
scalar File length (in bytes)
boolean True if the file is empty
Type of the content
Contents of the file decoded using UTF-8 encoding
Iterates over the lines of a file
This type is serializable.
Access: Get only Type:
Type of the content as a string. Can be one of the following:
- Content too short to establish a type
- A file containing ASCII text, like the result of a LOG command.
- A type of file containing KerboMachineLanguage compiled code, that was created from the COMPILE command.
- Any other type of file.