Name
FileToString -- read whole file into a string (V5.0)
Synopsis
s$, len = FileToString(file$[, t])
Function
This command is a convenience function which simply reads the specified file into memory and returns it as a string. The second return value contains the file length in bytes. Note that since Hollywood strings can also contain binary data, you can also use this function to read non-text files into strings.

Starting with Hollywood 10.0, FileToString() accepts an optional table argument that allows you to pass additional arguments to the function. The following tags are currently supported by the optional table argument:

Adapter:
This tag allows you to specify one or more file adapters that should be asked if they want to open the specified file. If you use this tag, you must set it to a string containing the name(s) of one or more adapter(s). Defaults to the adapter set using SetDefaultAdapter(). See Loaders and adapters for details. (V10.0)

UserTags:
This tag can be used to specify additional data that should be passed to file adapters. If you use this tag, you must set it to a table of key-value pairs that contain the additional data that should be passed to plugins. See User tags for details. (V10.0)

Inputs
file$
file to read into string
t
optional: table containing additional options (see above) (V10.0)
Results
s$
contents of the specified file as a string
len
length of the file in bytes

Show TOC