diff options
author | San Jacobs | 2024-09-15 19:09:40 +0200 |
---|---|---|
committer | San Jacobs | 2024-09-15 19:09:40 +0200 |
commit | 90f807a2e6c5a960b1904b8aa4cba75557329d41 (patch) | |
tree | 09189e2915a7c2750a249df0d08d2e32da3d8685 | |
parent | a924aca70ea52dba19aa0a4d47b06c67fae1b587 (diff) | |
download | better-report-90f807a2e6c5a960b1904b8aa4cba75557329d41.tar.gz better-report-90f807a2e6c5a960b1904b8aa4cba75557329d41.tar.bz2 better-report-90f807a2e6c5a960b1904b8aa4cba75557329d41.zip |
Fixed writing output file on Linux
-rwxr-xr-x | main.odin | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -186,12 +186,15 @@ main :: proc() { output_file_name := fmt.aprintf("{}_Knekt.html", os.args[1][:len(os.args[1])-4])
os.remove(output_file_name)
output_file_handle, _ := os.open(output_file_name, os.O_CREATE, 0o777)
- os.write_string(output_file_handle, "") // TODO: Figure out how to write this to a file
+ os.close(output_file_handle)
+ output_file_handle, _ = os.open(output_file_name, os.O_RDWR, 0o777)
os.write_string(output_file_handle, total_output) // TODO: Figure out how to write this to a file
os.close(output_file_handle)
- fmt.printf("Wrote file: {}", output_file_name)
- //fmt.printf("\n\n\nTOTAL OUTPUT:\n\n\n")
- //fmt.println(total_output)
+
+ fmt.printf("Wrote file: {}\n", output_file_name)
+
+ /*fmt.printf("\n\n\nTOTAL OUTPUT:\n\n\n")
+ fmt.println(total_output)*/
}
append :: proc(input, to_add: string) -> string {
|