run_file
Run an existing file and return its exit code, duration, stdout and stderr inline. Choose an interpreter, pass arguments and stdin, and set a timeout to capture output or fail on errors.
Instructions
Run a file that already exists and return its output inline: exit code, duration, stdout and stderr. Nothing is copied or stored -- the file you name is the file that runs, with cwd = its own directory. lang=auto guesses from the extension and honours a #! for executables; lang=python uses Sage's own interpreter (so from sage.all import * works) and lang=sage shells out to sage. A non-zero exit or a timeout is an error, with the output attached; the timeout kills the whole process group.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (default: the file's own directory). | |
| args | No | Arguments appended to the command line. | |
| lang | No | Interpreter; auto uses the extension, then the #! line. | |
| path | Yes | The file to run (absolute or relative to this server's cwd). | |
| stdin | No | Text fed to the file on stdin. | |
| timeout_s | No | Seconds before the process group is killed. |