aboutsummaryrefslogtreecommitdiff
path: root/player/utilities.F90
diff options
context:
space:
mode:
Diffstat (limited to 'player/utilities.F90')
-rw-r--r--player/utilities.F9022
1 files changed, 18 insertions, 4 deletions
diff --git a/player/utilities.F90 b/player/utilities.F90
index c7fd523..2e19031 100644
--- a/player/utilities.F90
+++ b/player/utilities.F90
@@ -157,6 +157,7 @@ contains
integer(kind=c_int32_t)::GetTempPath
integer(kind=c_int32_t), value::n
type(c_ptr), value::b
+ end function GetTempPath
function GetTempFileName(pn, prefix, unique, b) bind(c, name='GetTempFileNameA')
use iso_c_binding
@@ -169,13 +170,13 @@ contains
type(c_ptr)::tmp_path
integer::res
- tmp_path = c_malloc(1024)
+ tmp_path = c_malloc(int(1024, kind=c_size_t))
res = GetTempPath(1023, tmp_path)
- tmp_name = c_malloc(1024)
- res = GetTempFileName(tmp_path, c_null_ptr(), 0, tmp_name)
+ tmp_name = c_malloc(int(1024, kind=c_size_t))
+ res = GetTempFileName(tmp_path, c_null_ptr, 0, tmp_name)
- c_free(tmp_path)
+ call c_free(tmp_path)
#else
interface
function tmpnam(p) bind(c, name='tmpnam')
@@ -205,4 +206,17 @@ contains
end function generate_temporary_filename
+ subroutine delete_file(filename)
+ implicit none
+
+ character(*), intent(in)::filename
+
+#ifdef GNU
+ call unlink(filename)
+#else
+ ! Not implemented...
+#endif
+
+ end subroutine delete_file
+
end module utilities \ No newline at end of file