cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-6777) window.requestFileSystem(LocalFileSystem.TEMPORARY returns "/"
Date Thu, 29 May 2014 14:25:01 GMT

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

Ian Clelland edited comment on CB-6777 at 5/29/14 2:24 PM:
-----------------------------------------------------------

This is, -as [~agrieve] mentioned,- mostly due to the use of the now-deprecated {{fullPath}}
property. (Edit: No, he didn't say that. I made that up)

However, there is another issue which I spotted in the Android code -- the {{fs.root}} object
doesn't have a native URL assigned (it's {{null}} in the output above), and so it may behave
oddly in other cases. I've made CB-6778 for that problem.


was (Author: iclelland):
This is, as [~agrieve] mentioned, mostly due to the use of the now-deprecated {{fullPath}}
property.

However, there is another issue which I spotted in the Android code -- the {{fs.root}} object
doesn't have a native URL assigned (it's {{null}} in the output above), and so it may behave
oddly in other cases. I've made CB-6778 for that problem.

> window.requestFileSystem(LocalFileSystem.TEMPORARY returns "/"
> --------------------------------------------------------------
>
>                 Key: CB-6777
>                 URL: https://issues.apache.org/jira/browse/CB-6777
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.5.0
>            Reporter: Axel Nennker
>
> In the code below I get a 
> java.io.FileNotFoundException: /tmpfile.tmp: open failed: EROFS (Read-only file system)

> because the request for a temporary filesystem returns "/".
> {code}
> 60           window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function(fs){
> 61 for (var p in fs.root) {
> 62   Framework.util.LogUtil.i(this.$className, 'getImport() fs.root['+p+'] =' + fs.root[p]);-
> 63 }
> 64               fs.root.getFile("tmpfile.tmp", {create: true, exclusive: false},
> 65                 function(entry){
> 66                   var fileTransfer = new FileTransfer();
> 67                   fileTransfer.download(
> 68                           aFile,
> 69                           entry.fullPath,
> 70                           function(entry) {
> 71                               console.log("download complete: " + entry.fullPath);
> 72                               aSuccess(entry);
> 73                           },
> 74                           function(error) {
> 75                               console.log("error source " + error.source);
> 76                               console.log("error target " + error.target);
> 77                               console.log("error code " + error.code);
> 78                               aFail(error);
> 79                           },
> 80                           false,
> 81                           {
> 82                              headers: {
> 83                               'Content-Type': 'application/json'
> 84                              }
> 85                           }
> 86                   );
> 87               }, function(error){
> 88                 Framework.util.LogUtil.e(this.$className, 'getImport() download error
=' + error);-
> 89                 aFail(error);
> 90               });
> 91           }, null);
> 92 
> 93         },
> {code}
> I/Web Console(22297): [I]  :: getImport() fs.root[isFile] =false:37
> I/Web Console(22297): [I]  :: getImport() fs.root[isDirectory] =true:37
> I/Web Console(22297): [I]  :: getImport() fs.root[name] =:37
> I/Web Console(22297): [I]  :: getImport() fs.root[fullPath] =/:37
> I/Web Console(22297): [I]  :: getImport() fs.root[filesystem] =[object Object]:37
> I/Web Console(22297): [I]  :: getImport() fs.root[nativeURL] =null:37
> This happened after I updated the file and the file-transfer plugins in my project. It
worked with the old versions (about one year older).
> Not sure what the temporary filesystem should be on Android but "/" is wrong.



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

Mime
View raw message