Module wf.api.v1.process
wf-process helper functions
Functions
tmpfile (ext) | Allocate a temporary file. |
filename (obj) | Retrieve a filename from a string or file reference. |
to_file (obj) | Convert a filename or reference to a file reference. |
to_data (obj) | Convert a binary data string or reference to a binary data reference. |
inputs (...) | Return a list of inputs applicable to this execution of the script, optionally filtered by extension. |
touch (name, mode) | Access a file without opening or closing it. |
symbol (file) | Create a symbol name from a string or file reference. |
emit_symbol (name, data) | Emit a symbol accessible to C code. |
Functions
- tmpfile (ext)
-
Allocate a temporary file.
This file will be deleted once wf-process finishes operation.
Parameters:
- ext optional string File extension.
Returns:
-
process.File
Temporary file reference.
- filename (obj)
-
Retrieve a filename from a string or file reference.
Parameters:
- obj string or process.File
Returns:
-
optional string
Filename.
- to_file (obj)
-
Convert a filename or reference to a file reference.
Parameters:
- obj string, process.Data or process.File Reference or filename.
Returns:
-
process.File
File reference.
- to_data (obj)
-
Convert a binary data string or reference to a binary data reference.
Parameters:
- obj string, process.Data or process.File Reference or filename.
Returns:
-
process.Data
Binary data reference.
- inputs (...)
-
Return a list of inputs applicable to this execution of the script,
optionally filtered by extension.
Parameters:
- ... optional string Optional extensions to filter by.
Returns:
-
{process.File,...}
Table of process files.
- touch (name, mode)
-
Access a file without opening or closing it.
This is required to correctly emit Makefile dependency files, if a file
is not accessed via Lua's "io" package (for example, by an external tool).
Parameters:
- symbol (file)
-
Create a symbol name from a string or file reference. Error if not possible.
Parameters:
- file string or process.File File reference or filename.
Returns:
-
string
Symbol name.
- emit_symbol (name, data)
-
Emit a symbol accessible to C code.
Parameters:
- name string or process.File Symbol name; can be generated automaticaly from an input file.
- data string, table, process.Data or process.File Data to emit.