mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-02 19:00:47 +08:00
[web] Fixed failures when creating tmp files on linxu
This commit is contained in:
@@ -93,7 +93,7 @@ const char* nasal_eval(void* context, const char* code, int show_time) {
|
||||
|
||||
// Create a unique temporary file
|
||||
char temp_filename[256];
|
||||
snprintf(temp_filename, sizeof(temp_filename), "/tmp/nasal_eval_%ld.nasal", std::time(nullptr));
|
||||
snprintf(temp_filename, sizeof(temp_filename), "/tmp/nasal_eval_%ld_XXXXXX", std::time(nullptr));
|
||||
int fd = mkstemp(temp_filename);
|
||||
if (fd == -1) {
|
||||
throw std::runtime_error("Failed to create temporary file");
|
||||
|
||||
Reference in New Issue
Block a user