Files
MagicSetEditor2/doc/function/write_text_file.txt
T
twanvl 42d40dbd1e Added Package::saveCopy, which is used to implement the write_set_file script function.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1169 0fc631ac-6414-0410-93d0-97cfa31319b6
2008-08-24 19:48:51 +00:00

23 lines
733 B
Plaintext

Function: write_text_file
--Usage--
> write_text_file(some_string, file: filename)
Write a string to a file in the output directory.
If a file with the given name already exists it is overwritten.
Returns the name of the file written.
This function can only be used in an [[type:export template]], when <tt>create directory</tt> is true.
--Parameters--
! Parameter Type Description
| @input@ [[type:string]] Text to write to the file.
| @file@ [[type:string]] Name of the file to write to
--Examples--
> write_text_file(file:"index.html", lots_of_html_code) == "index.html" # index.html now contains the given text
--See also--
| [[fun:write_image_file]] Write an image file to the output directory.