Files
mgmt/examples/lang/sendrecv-export.mcl
James Shubin 774d408e13 engine: Fix up some send/recv corner cases
Initially I wasn't 100% clear or decided on the send/recv semantics.
After some experimenting, I think this is much closer to what we want.
Nothing should break or regress here, this only enables more
possibilities.
2025-05-05 23:53:37 -04:00

21 lines
369 B
Plaintext

import "os"
$f = "/tmp/export1"
exec "a" {
shell => "/bin/bash",
cmd => "echo hello | tee ${f}",
creates => "${f}",
send_output => os.readfile("${f}"), # extra graph event but safer in debug
Before => File["${f}"],
}
file "${f}" {
state => $const.res.file.state.exists,
mode => "ug=rw,o=",
Meta:export => ["*",],
}
Exec["a"].output -> File["${f}"].content