You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by ghenry22 <gi...@git.apache.org> on 2015/10/22 07:54:20 UTC

[GitHub] cordova-plugin-file pull request: Windows prefix paths

Github user ghenry22 commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/121#issuecomment-150114300
  
    Have tried this on a windows 10 universal app and had some issues.
    
    cordova.file values seem to return a absolute path eg:
    
    cordova.file.dataDirectory returns c:\... etc when I would expect it to return ms-appdata:///local/ which is the accessible path for the app to reach persistent storage.
    
    with the absolute path returned functions like checkDir, checkFile always fail.
    
    window.resolvelocalfilesystemurl(cordova.file.dataDirectory) always throws a error code 5 encoding error when using this PR.
    
    If I remove this PR code and go back to master and manually specify the value of cordova.file.dataDirectory to the ms-appdata url above then resolvelocalfilesystemurl works as expected as do other core file plugin functions like checkdir, checkfile etc.
    
    so I have reverted back to using the current release of the file plugin with the following code added to my app.js:
    
        //Init file systems for Windows
        if (cordova.platformId === "windows"){
          console.log("platform is windows");
          cordova.file = {
            dataDirectory: "ms-appdata:///local/",
            cacheDirectory: "ms-appdata:///temp/",
            tempDirectory: "ms-appdata:///temp/",
            applicationDirectory: "ms-appdata:///"
          };
        };
    
    This resolve the immediate problem and the app works now when I build for the windows platform and test on windows 10, but perhaps you could adjust this PR to take this into account so that the cordova.file.* constants work as expected for the file systems that are available on windows without requiring a workaround.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org