File modification time: Difference between revisions

m
(Initial FutureBasic task solution added)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 1,518:
{{libheader|Wren-date}}
As there is currently no way for Wren-cli to get or set file modification times, we instead use an embedded script so the C host can do this for us.
<syntaxhighlight lang="ecmascriptwren">/* file_mod_time_wrenFile_modification_time_wren */
 
import "./date" for Date
Line 1,553:
<br>
We now embed this in the following C program, build and run it:
<syntaxhighlight lang="c">/* gcc file_mod_timeFile_modification_time.c -o file_mod_timeFile_modification_time -lwren -lm */
 
#include <sys/stat.h>
Line 1,691:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "file_mod_timeFile_modification_time.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
9,476

edits