ffi issues
#4255
Replies: 1 comment
-
The string[] memory inputs = new string[](4);
inputs[0] = "sh";
inputs[1] = "-c";
inputs[2] = "printf hello > test.txt";
vm.ffi(inputs); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I wrote a foundry script with essentially logs some storage to a file, before and after the execution of some commands.
Afterwards i want to diff these two files, which works just fine via Makefile:
Now i noticed that doing this, after the script execution is a bit cumbersome and i'd rather have the diffing be part of the foundry script, but I simply can't manage to.
I tried to essentially execute the whole command via
ffi
which threw a gazillion of rather weird errors(https://book.getfoundry.sh/cheatcodes/ffi?highlight=ffi#ffi).So I tried reducing complexity to sth like
printf hello > test.txt
just to see if it works in general:Which yields
2023-02-02T16:56:28.504122Z ERROR foundry_evm::executor::inspector::cheatcodes::ext: stderr err="printf: warning: ignoring excess arguments, starting with ‘>’\n"
.Is there any way to do what i want to do via foundry?
Essentially I want to exec a command without caring for the response, so perhaps ffi might not be the correct tool for the job.
Beta Was this translation helpful? Give feedback.
All reactions