git.iko.soy
/
Idris-dev
readme
files
commits
refs
on
master
help
sign in
add currentDir
d026c4e
doofin
8 years ago
libs/prelude/Prelude/File.idr
+4
compare with master
unified
split
@@ -375,3 +375,7 @@ changeDir : String -> IO Bool
375
changeDir dir
375
changeDir dir
376
= do ok <- foreign FFI_C "idris_chdir" (String -> IO Int) dir
376
= do ok <- foreign FFI_C "idris_chdir" (String -> IO Int) dir
377
pure (ok == 0)
377
pure (ok == 0)
378
+
379
+
export
380
+
currentDir : IO String
381
+
currentDir = foreign FFI_C "idris_currentDir" (IO String)
rts/idris_stdfgn.c
+8
@@ -259,3 +259,11 @@ VAL idris_getString(VM* vm, void* buffer) {
259
free(sb);
259
free(sb);
260
return
str;
260
return
str;
261
}
261
}
262
+
263
+
char* idris_currentDir() {
264
+
char cwd[
1024
];
265
+
if
(getcwd(cwd,
sizeof
(cwd)) !=
NULL
)
266
+
return
cwd
267
+
else
268
+
return
"getcwd() error"
269
+
}
rts/idris_stdfgn.h
+2
@@ -55,4 +55,6 @@ VAL idris_time();
55
55
56
void idris_forceGC();
56
void idris_forceGC();
57
57
58
+
char* idris_currentDir();
59
+
58
#endif
60
#endif
keys
esc to close
j k
move down, up
enter
open
esc
back, or up a level
1 2 3 4
readme, files, commits, refs
/
filter
y
copy the clone command
c
compare the chosen commit with another (or shift-click both)
?
show or hide this list