From 4c81888944f3d9b2cb651c0e70583b2849834219 Mon Sep 17 00:00:00 2001 From: martinw Date: Tue, 13 Mar 2001 11:22:21 +0000 Subject: enable compiler to create "Clean System Files" folder git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@325 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- main/Windows/CoclSystemDependent.icl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'main/Windows') diff --git a/main/Windows/CoclSystemDependent.icl b/main/Windows/CoclSystemDependent.icl index dc1d17b..867bcd2 100644 --- a/main/Windows/CoclSystemDependent.icl +++ b/main/Windows/CoclSystemDependent.icl @@ -1,6 +1,9 @@ // this is for Windows implementation module CoclSystemDependent +import StdEnv +import code from "cDirectory.obj", library "directory_library" // Windows + PathSeparator :== ';' DirectorySeparator @@ -13,3 +16,27 @@ SystemDependentDevices SystemDependentInitialIO :: [a] SystemDependentInitialIO = [] + +ensureCleanSystemFilesExists :: !String !*Files -> (!Bool, !*Files) +// returned bool: now there is such a subfolder +ensureCleanSystemFilesExists path env + # path_c_string = path +++ "\0" + (err_code, env) = createDirectoryC path_c_string env + = (err_code==M_NoDirError || err_code==M_AlreadyExists, env) + +createDirectoryC :: !String !*env -> (!Int, !*env) +createDirectoryC _ _ + = code + { + ccall createDirectoryC "S:I:A" + } + +// createDirectoryC returns the following error codes: +M_NoDirError :== 0 +M_OtherDirError :== -1 +M_DoesntExist :== -2 +M_BadName :== -3 +M_NotEnoughSpace :== -4 +M_AlreadyExists :== -5 +M_NoPermission :== -6 + -- cgit v1.2.3