diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj
index 32b55721c..760e382c0 100644
--- a/CrossPlatformModules.csproj
+++ b/CrossPlatformModules.csproj
@@ -2099,6 +2099,7 @@
PreserveNewest
+
@@ -2196,7 +2197,7 @@
False
-
+
\ No newline at end of file
diff --git a/apps/tests/file-system-access-tests/file-system-access-tests.ts b/apps/tests/file-system-access-tests/file-system-access-tests.ts
index 3ef17f117..b9b318a3d 100644
--- a/apps/tests/file-system-access-tests/file-system-access-tests.ts
+++ b/apps/tests/file-system-access-tests/file-system-access-tests.ts
@@ -22,4 +22,15 @@ export var test_UTF8_BOM_is_not_returned = function () {
TKUnit.assert(actualCharCode === expectedCharCode, "Actual character code: " + actualCharCode + "; Expected character code: " + expectedCharCode);
}
};
+
+export var test_file_exists_on_folder = function () {
+ var path = fs.path.join(__dirname, "folder");
+
+ if (!fs.Folder.exists(path)) {
+ TKUnit.assert(false, `Could not read path ${path}`);
+ return;
+ }
+
+ TKUnit.assertFalse(fs.File.exists(path), "File.exists() returned true for folder!");
+};
\ No newline at end of file
diff --git a/apps/tests/file-system-access-tests/folder/file.expected b/apps/tests/file-system-access-tests/folder/file.expected
new file mode 100644
index 000000000..5f282702b
--- /dev/null
+++ b/apps/tests/file-system-access-tests/folder/file.expected
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/file-system/file-system-access.ios.ts b/file-system/file-system-access.ios.ts
index d7b4b9f3f..e7cd964a8 100644
--- a/file-system/file-system-access.ios.ts
+++ b/file-system/file-system-access.ios.ts
@@ -148,7 +148,7 @@ export class FileSystemAccess {
public fileExists(path: string): boolean {
var fileManager = NSFileManager.defaultManager();
- return fileManager.fileExistsAtPath(path);
+ return fileManager.fileExistsAtPath(path) && !this.folderExists(path);
}
public folderExists(path: string): boolean {