You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Axel Nennker (JIRA)" <ji...@apache.org> on 2014/05/29 16:15:02 UTC

[jira] [Updated] (CB-6777) window.requestFileSystem(LocalFileSystem.TEMPORARY returns "/"

     [ https://issues.apache.org/jira/browse/CB-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Axel Nennker updated CB-6777:
-----------------------------

    Description: 
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.


  was:
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 "/".

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         },

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.



> 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)