Index: cpp/common/virtfile/stdiofile.cpp
===================================================================
--- cpp/common/virtfile/stdiofile.cpp	(revision 819)
+++ cpp/common/virtfile/stdiofile.cpp	(revision 820)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -29,8 +29,8 @@
 	//log_printf("Vopendir %s",path);
 #ifdef __ANDROID__
-	int resources_prefix_length=getAppResourcesDir().length();
+	int resources_prefix_length = getAppResourcesDir().length();
 	if (strncmp(path, getAppResourcesDir().c_str(), resources_prefix_length) == 0) //it is a resources dir
 	{
-		VirtDIR *vd = AndroidAPK_DIR::opendir(path+resources_prefix_length+1); //+1 because we also skip '/' and start with a "relative" dir, otherwise it does not work.
+		VirtDIR *vd = AndroidAPK_DIR::opendir(path + resources_prefix_length + 1); //+1 because we also skip '/' and start with a "relative" dir, otherwise it does not work.
 		return vd;
 	}
@@ -51,4 +51,32 @@
 }
 
+bool StdioFileSystem::Vdirexists(const char* path, bool is_writable)
+{
+#ifdef __ANDROID__
+	int resources_prefix_length = getAppResourcesDir().length();
+	if (strncmp(path, getAppResourcesDir().c_str(), resources_prefix_length) == 0) //it is a resources dir
+	{
+		if (is_writable)
+			return false;
+		VirtDIR *vd = AndroidAPK_DIR::opendir(path + resources_prefix_length + 1); //+1 because we also skip '/' and start with a "relative" dir, otherwise it does not work.
+		if (vd != NULL)
+		{
+			delete vd;
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+#endif
+	return directoryExists(path, is_writable);
+}
+
+
+
+
+
+
 #ifndef NO_STD_IN_OUT_ERR
 void StdioFILE::setStdio()
@@ -67,6 +95,6 @@
 	//log_printf("Vreaddir %s",dir);
 #ifdef _WIN32
-	wdirent *wde=wreaddir(dir);
-	if (wde==NULL) return NULL;
+	wdirent *wde = wreaddir(dir);
+	if (wde == NULL) return NULL;
 	strcpy(de.d_name, Convert::wstrToUtf8(wde->d_name).c_str());
 	return &de;
Index: cpp/common/virtfile/stdiofile.h
===================================================================
--- cpp/common/virtfile/stdiofile.h	(revision 819)
+++ cpp/common/virtfile/stdiofile.h	(revision 820)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -17,5 +17,5 @@
 	VirtDIR *Vopendir(const char* path);
 	bool Vmkdir(const char* path) { return makeDirectory(path); }
-	bool Vdirexists(const char* path,bool is_writable) { return directoryExists(path,is_writable); }
+	bool Vdirexists(const char* path, bool is_writable);
 };
 
@@ -26,6 +26,6 @@
 	MFILE *file;
 public:
-	StdioFILE(MFILE *f):VirtFILE("") { file = f; }
-	StdioFILE(MFILE *f, const char* p):VirtFILE(p) { file = f; }
+	StdioFILE(MFILE *f) :VirtFILE("") { file = f; }
+	StdioFILE(MFILE *f, const char* p) :VirtFILE(p) { file = f; }
 #ifndef NO_STD_IN_OUT_ERR
 	static void setStdio();
@@ -48,6 +48,6 @@
 	FILE *file;
 public:
-	StdioFILE(FILE *f):VirtFILE("") { file = f; }
-	StdioFILE(FILE *f, const char* p):VirtFILE(p) { file = f; }
+	StdioFILE(FILE *f) :VirtFILE("") { file = f; }
+	StdioFILE(FILE *f, const char* p) :VirtFILE(p) { file = f; }
 #ifndef NO_STD_IN_OUT_ERR
 	static void setStdio();
@@ -73,10 +73,10 @@
 #ifdef _WIN32
 #ifdef __BORLANDC__
- typedef wDIR DIRTYPE;
+typedef wDIR DIRTYPE;
 #else
- typedef WDIR DIRTYPE;
+typedef WDIR DIRTYPE;
 #endif
 #else
- typedef DIR DIRTYPE;
+typedef DIR DIRTYPE;
 #endif
 
@@ -111,10 +111,10 @@
 };
 
-class StdioFileSystem_autoselect: public StdioFileSystem
+class StdioFileSystem_autoselect : public StdioFileSystem
 {
 public:
-StdioFileSystem_autoselect()
+	StdioFileSystem_autoselect()
 	{
-	VirtFILE::selectFileSystem(this);
+		VirtFILE::selectFileSystem(this);
 	}
 };
