Kay
Kay13mo ago

Compiled program cannot write to file

I made a program that can download the latest version of papermc or velocity. and it does download it but it also should update the config file to set the latest build value to the build number of the downloaded jar. and just by running deno run -A ./Main.ts that does work but after compiling it it doesn't. it still downloads the jar
2 Replies
Deno AI Helper
Deno AI Helper13mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, it's possible that the issue might be related to the permissions or the way the file paths are being handled in the compiled version of your program. When you compile a Deno program using deno compile, the permissions you've granted during compilation are baked into the binary. If you need to write to a file, make sure you've included the --allow-write flag during the compilation process. For example:
deno compile --allow-write -o my_program Main.ts
deno compile --allow-write -o my_program Main.ts
This is not based on the Deno documentation, so please double-check the accuracy of this advice. If the issue persists, you may want to look into how file paths are resolved in the compiled binary or consider other potential differences between the runtime and compiled environments.
Kay
KayOP13mo ago
i did compile it with the -A option so that shoudnt be a problem

Did you find this page helpful?