Returns a securer::securer_tool() that writes data to files in
specified directories with size limits and overwrite protection.
Details
The content argument type is declared as "list" in the tool schema
because the IPC serialization layer (JSON) converts most R objects to
lists. In practice, callers should pass:
A
data.framefor CSV and JSON formatsA character vector for TXT format
Any R object for RDS format
Supported formats: csv, json, txt, rds. Format is auto-detected from the file extension, or can be specified explicitly.
Security constraints:
Atomic writes: Data is written to a temp file first, validated for size, then moved to the target path.
Overwrite protection: By default, existing files cannot be overwritten (controlled by the
overwriteparameter).Symlink resolution: Target paths are resolved via
base::normalizePath()to prevent symlink-based directory escapes.Size limits: Written files exceeding
max_file_sizeare rejected before being moved to the target.
See also
Other tool factories:
calculator_tool(),
data_profile_tool(),
fetch_url_tool(),
plot_tool(),
query_sql_tool(),
r_help_tool(),
read_file_tool()