Water 5-System Interfaces-FilesystemSet content of a file
Contract| Return type | wob | | Parameter key | Default value | Type | | content | req | | Water Contract<method resource.filesystem.file.set
content=req/> | |
See also: file, folder, exists, create, set_file_content_and_create_folders_as_needed
To write content to a file, use the syntax:
a_file.<set content="new content"/>
Note that if the new content is a string it writes out the string.
If the new content is a hypertext object, then the to_html
method is automatically called on it to convert it to a string
before writing to the file.
If the new content is another kind of object, then the
to_cxs method is called on it to convert it to a string
before writing to the file.
set with a _subject of a file can only take one argument which must be
the content whose value must be a string.
the content of the file will be set to the string.
Note that you must use:
a_file.<set content="some value"/>
i.e. you must use the key "content".
If the new content is not a string, then to_cxs is called
on it and the resulting string is written to the file.
© Copyright 2007 Clear Methods, Inc.