summaryrefslogtreecommitdiff
path: root/src/UT/DELFILE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/UT/DELFILE.cpp')
-rw-r--r--src/UT/DELFILE.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/UT/DELFILE.cpp b/src/UT/DELFILE.cpp
new file mode 100644
index 0000000..6bc2489
--- /dev/null
+++ b/src/UT/DELFILE.cpp
@@ -0,0 +1,43 @@
+/* ------------------------------
+ * Fil: DelFile.c
+ * ------------------------------ */
+
+#include "stdafx.h"
+
+#ifdef LINUX
+# include <unistd.h>
+# define UT_access access
+#else
+# include <io.h>
+# define UT_access _access
+#endif
+
+#include "fyut.h"
+
+/*
+AR-921013
+CH UT_DeleteFile Sletter en fil
+CD ==================================================================
+CD Formål:
+CD Sletter en fil.
+CD
+CD PARAMETERLISTE:
+CD Type Navn I/U Merknad
+CD ------------------------------------------------------------------
+CD char *pszPath i Filnavn
+CD short sStatus r Status; 0=OK, annen verdi er feil.
+CD
+CD Bruk: sStatus = UT_DeleteFile(szPath);
+ ==================================================================
+*/
+
+SK_EntPnt_UT short UT_DeleteFile(char *pszPath)
+{
+ // Sjekk at filen finnes
+ if( (UT_access( pszPath, 0 )) == 0 ) {
+ /* Sletter eventuell gammel hjelpefil */
+ return remove(pszPath);
+ }
+
+ return 0;
+}