diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/utilities.F90 | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/common/utilities.F90 b/common/utilities.F90 index 4c0c13f..abf6bc1 100644 --- a/common/utilities.F90 +++ b/common/utilities.F90 @@ -187,7 +187,7 @@ contains function c_strlen(p) bind(c, name='strlen') use iso_c_binding type(c_ptr), value::p - integer(kind=c_size_t)::strlen + integer(kind=c_size_t)::c_strlen end function c_strlen function c_malloc(x) bind(c, name='malloc') @@ -220,8 +220,9 @@ contains end function GetTempFileName end interface - type(c_ptr)::tmp_path + type(c_ptr)::tmp_path, tmp_prefix integer::res + character(len=4, kind=c_char), target::prefix tmp_path = c_malloc(int(1024, kind=c_size_t)) if(.not. associated(temporary_directory)) then @@ -230,8 +231,11 @@ contains tmp_path = c_loc(temporary_directory) end if + Print *, res + tmp_name = c_malloc(int(1024, kind=c_size_t)) - res = GetTempFileName(tmp_path, c_null_ptr, 0, tmp_name) + prefix = "lev"//c_null_char + res = GetTempFileName(tmp_path, c_loc(prefix), 0, tmp_name) if(.not.associated(temporary_directory)) then call c_free(tmp_path) @@ -429,7 +433,6 @@ contains end function get_directories_in_directory function get_files_in_directory(directory) result(res) - use logging implicit none character(*), intent(in)::directory |