Commit 8f637af4 authored by John van Groningen's avatar John van Groningen

implement function FExists and add function GetCurrentDirectory, used by cpm

parent f465418e
......@@ -5,5 +5,6 @@ from UtilDate import ::DATE
GetFullApplicationPath :: !*Files -> (!{#Char},!*Files)
GetLongPathName :: !{#Char} -> {#Char}
FModified :: !String !Files -> (!DATE, !Files);
FExists :: .a
FModified :: !String !Files -> (!DATE, !Files)
FExists :: !String !Files -> (!Bool, !Files)
GetCurrentDirectory :: (!Bool,!String)
......@@ -101,5 +101,23 @@ free p = code {
ccall free "p:I"
}
FExists :: .a;
FExists = abort "FExists";
FExists :: !String !Files -> (!Bool, !Files);
FExists name files
# s = createArray (IF_INT_64_OR_32 144 88) '\0';
# r = stat (name+++"\0") s;
| r<>0
= (False,files);
= (True,files);
getcwd :: !{#Char} !Int -> Int;
getcwd buffer buffer_size = code {
ccall getcwd "sp:p"
}
GetCurrentDirectory :: (!Bool,!String);
GetCurrentDirectory
# p = getcwd (createArray 512 '\0') 512;
| p==0
= (False,"");
# (s,_) = c_string_to_clean_string p;
= (True,s);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment