You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Matti Eerola (JIRA)" <ji...@apache.org> on 2014/01/11 22:29:50 UTC

[jira] [Commented] (CB-5747) Windows 8: DirectoryEntry.getDirectory fails when path contains directory separator

    [ https://issues.apache.org/jira/browse/CB-5747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13868881#comment-13868881 ] 

Matti Eerola commented on CB-5747:
----------------------------------

A quick fix can be found here:
https://github.com/spMatti/cordova-plugin-file/commit/3e4f9cdc287d907679a47a32f95238180c774860

> Windows 8: DirectoryEntry.getDirectory fails when path contains directory separator
> -----------------------------------------------------------------------------------
>
>                 Key: CB-5747
>                 URL: https://issues.apache.org/jira/browse/CB-5747
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File, Windows 8
>    Affects Versions: 3.3.0
>         Environment: Windows 8.0 
>            Reporter: Matti Eerola
>            Assignee: Jesse MacFadyen
>            Priority: Minor
>
> Code:
> {code:javascript}
>       window.requestFileSystem(LocalFileSystem.PERSISTENT, 5*1024*1024*1024, function(fs){
>         fs.root.getDirectory('foo/bar', {create:true}, function(newDir){
>         });
>       });
> {code}
> Problem:
> The directory separator for File Api is '/' (U+002F). So 'foo/bar' argument should be correct. src/windows8/FileProxy.js passes path attribute directly to storageFolder.createFolderAsync that uses backslash '\' (U+005c) as directory separator. The result is invalid path error from createFolderAsync.
> This code works, but is nonstandard:
> {code:javascript}
>       window.requestFileSystem(LocalFileSystem.PERSISTENT, 5*1024*1024*1024, function(fs){
>         fs.root.getDirectory('foo\\bar', {create:true}, function(newDir){
>         });
>       });
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)