Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-5747

Windows 8: DirectoryEntry.getDirectory fails when path contains directory separator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.0
    • None
    • None
    • Windows 8.0

    Description

      Code:

            window.requestFileSystem(LocalFileSystem.PERSISTENT, 5*1024*1024*1024, function(fs){
              fs.root.getDirectory('foo/bar', {create:true}, function(newDir){
      
              });
            });
      

      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:

            window.requestFileSystem(LocalFileSystem.PERSISTENT, 5*1024*1024*1024, function(fs){
              fs.root.getDirectory('foo\\bar', {create:true}, function(newDir){
      
              });
            });
      

      Attachments

        Issue Links

          Activity

            People

              purplecabbage Jesse MacFadyen
              matti-eerola Matti Eerola
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: