Files
mgmt/lang/interpret_test/TestAstFunc2/deploy-readfile0/mod1/main.mcl
James Shubin ed4ee3b58e lang: funcs: Add deploy package with readfile related functions
This adds a readfile function to actually access files from our deploy.
A fun side effect is that we can even access our own code! In general,
it's a good reminder that you should only run trusted code on your own
infrastructure. This also includes a fancy new test case.
2019-07-26 03:38:26 -04:00

7 lines
149 B
Plaintext

import "deploy"
# relative paths for us
$f = "/files/file3" # real file is in: /mod1/files/file3
$f3 = deploy.abspath($f)
$x3 = deploy.readfile($f)