cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghenry22 <>
Subject [GitHub] cordova-plugin-file pull request: Windows prefix paths
Date Thu, 22 Oct 2015 05:54:20 GMT
Github user ghenry22 commented on the pull request:
    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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message