implemented for ios as well

This commit is contained in:
Vladimir Enchev
2016-02-11 16:55:19 +02:00
parent 5c1639b36f
commit 06d914da5a
4 changed files with 15 additions and 2 deletions

View File

@ -2099,6 +2099,7 @@
<Content Include="apps\custom-root-view\package.json"> <Content Include="apps\custom-root-view\package.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="apps\tests\file-system-access-tests\folder\file.expected" />
<None Include="js-libs\esprima\LICENSE.BSD" /> <None Include="js-libs\esprima\LICENSE.BSD" />
<Content Include="source-control.md" /> <Content Include="source-control.md" />
<Content Include="ui\segmented-bar\package.json"> <Content Include="ui\segmented-bar\package.json">
@ -2196,7 +2197,7 @@
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties> </WebProjectProperties>
</FlavorProperties> </FlavorProperties>
<UserProperties ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" /> <UserProperties ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
</Project> </Project>

View File

@ -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); 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!");
};

View File

@ -0,0 +1 @@


View File

@ -148,7 +148,7 @@ export class FileSystemAccess {
public fileExists(path: string): boolean { public fileExists(path: string): boolean {
var fileManager = NSFileManager.defaultManager(); var fileManager = NSFileManager.defaultManager();
return fileManager.fileExistsAtPath(path); return fileManager.fileExistsAtPath(path) && !this.folderExists(path);
} }
public folderExists(path: string): boolean { public folderExists(path: string): boolean {