project_files/hwc/rtl/fileio.c
changeset 11682 2c21bc80c95d
parent 10575 13b1e9008f4b
child 14423 a32b967f1341
--- a/project_files/hwc/rtl/fileio.c	Sat Apr 23 16:18:07 2016 -0400
+++ b/project_files/hwc/rtl/fileio.c	Sat Apr 23 16:32:18 2016 -0400
@@ -8,9 +8,11 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
 io_result_t IOResult;
 int FileMode;
+char cwd[1024];
 
 static void init(File f) {
     f->fp = NULL;
@@ -219,6 +221,17 @@
     return false;
 }
 
+char * fpcrtl_getCurrentDir(void) {
+
+    IOResult = IO_NO_ERROR;
+
+    if (getcwd(cwd, sizeof(cwd)) != NULL)
+        return cwd;
+
+    IOResult = IO_ERROR_DUMMY;
+    return "";
+}
+
 void __attribute__((overloadable)) fpcrtl_flush(Text f) {
     fflush(f->fp);
 }