--- 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);
}