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

ASF GitHub Bot commented on CB-6923:
------------------------------------

Github user martincgg commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/65#issuecomment-49847041
  
    Given some of the variations on valid paths for Windows Phone, when a 
single '/' , '/dir//someDir and '///someDir' are valid paths, however a 
'/someDir' is not.
    However when the native side always returns a fileEntry as '//someDir or 
//someFile.ext, the double slash at the beginning it makes difficult to make a 
combination to get the full path and resolve a relative path(Path.GetFullPath), 
ignoring completely the two points in the path('..'), when more than one slash 
is present at the beginning of the string parent path.
    The RemoveExtraSlash, is a recursive function that removes the extra 
slashes from the beginning of the parent path, returning a proper path in order 
to be combined and resolved to an absolute path.
    
    The Path.GetFullPath it always returns a full path with a drive letter, 
which it will be replaced by the double slash to make it a valid path.


> [WP8][cordova-plugin-file] native side does not support relative paths
> ----------------------------------------------------------------------
>
>                 Key: CB-6923
>                 URL: https://issues.apache.org/jira/browse/CB-6923
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File, WP8
>    Affects Versions: 3.5.0
>            Reporter: Martin Gonzalez
>            Assignee: Martin Gonzalez
>              Labels: plugin-file
>             Fix For: 3.6.0
>
>
> The filesystem URIs on WP8, is not able to handle the resolve navigation a 
> parent directory using a relative path, e.g.:
> fileName = ../resolve.file.uri
> Instead is taking ".." as the parent directory not as navigation to the 
> parent directory.
> The filesystem should be able to resolve the path to the parent directory and 
> set root as the ultimate parent directory as well.
> {code}
> ../resolve.file.uri
> {code}
> and
> {code}
> /resolve.file.uri
> {code}
> Should be resolved to the same file, setting the file system root as the last 
> parent directory.
> This:
> {code}
> root.getDirectory(//someDir/someSubDir, function (dir) {
> dir.getFile("../valid.file.txt", .. );
> }, ..);
> {code}
> Should result this: 
> {code}
> "//someDir/valid.file.txt"
> {code}
> Navigation to parent directories should be supported.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to