Run as a daemon or service: Difference between revisions
m
→{{header|Wren}}: Minor tidy and rerun
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
m (→{{header|Wren}}: Minor tidy and rerun) |
||
Line 578:
An embedded program but the actual daemon is of course the C host even though the process is orchestrated by the Wren code which handles any errors and prints the time every second to the file.
The following script is based on the C example though modified a little to run on Ubuntu
<syntaxhighlight lang="
import "./date" for Date
Line 642:
<br>
We now embed this in the following C program, compile and run it.
<syntaxhighlight lang="c">/* gcc
#include <fcntl.h>
Line 775:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 798:
$ ./dumper dump
$ tail -f dump
Sat
Sat
Sat
Sat
Sat
Sat
Sat
Sat
Sat
Sat
^C
$ pkill -x dumper
|