This command is a convenience function which simply saves the string
specified in by s$
as the file specified by file$
. Be warned
that this function does not append the string to the file. If the file
specified by file$
already exists, it will be overwritten without any
warning. Note that since Hollywood strings can also contain binary data,
you can also use this function to write strings containing raw data to
files.
Starting with Hollywood 10.0, StringToFile()
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 save 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)