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

Thibault Durand resolved CB-7687.
---------------------------------
    Resolution: Fixed

Well, it was an undocumented feature that works, to make it work you should do 
that: 

All credit for this answer goes to Wei Li: 
https://github.com/weili-feedhenry/dotfiles/issues/1 , and you should read his 
post on cordova file system plugin: 
http://www.feedhenry.com/several-ways-avoid-problems-cordova-file-api-mobile-apps/

Apparently the File API doc is not up to date, in order to retrieve the file 
system you wanted, you need to change the request file system type in 
requestFileSystem call. For example:

window.requestFileSystem(3, 0, function(fs){
  alert("dataDirectory = " + cordova.file.dataDirectory);
  alert("root = " + fs.root.toURL());
  fs.root.getFile("test.txt", {create: true, exclusive: true});

}, function(){
  alert("failed to get file system”)
});
notice that the file system type in the above call is “3” - given that you only 
added the following preferences in the config.xml file:

If you change the value of iosExtraFilesystems, you may need to adjust the 
value of the request type accordingly.

> iOS8 : Unable to use iosExtraFileSystems
> ----------------------------------------
>
>                 Key: CB-7687
>                 URL: https://issues.apache.org/jira/browse/CB-7687
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 3.4.0, 3.5.0, 3.6.0
>         Environment: iOS 8
>            Reporter: Thibault Durand
>
> Hello, 
> I'm working with the filesystem plugin and i've an issue on iOS.
> I need to open a filesystem on the Library/NoCloud directory, the 
> documentation on github says that we should set these two variable in the 
> config.xml:
> <preference name="iosPersistentFileLocation" value="Library" />
> <preference name="iosExtraFilesystems" value="library-nosync" />
> But when i request the filesystem it gave me this path: Library/files , and 
> i'm unable to move to Library/NoCloud because the root is files.
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
>                     console.log("init fs sucess");
>  },function(error) {
>             console.log("Error init fs"+ error.code);
>  });
> I don't know if it's a bug or i've misinterpreted the documentation.
> To reproduce it, you can:
> -> create a test app
> -> install the file system plugin
> -> set these two variable in config.xml:
> <preference name="iosPersistentFileLocation" value="Library" />
> <preference name="iosExtraFilesystems" value="library-nosync" />
> -> request the file system, the path is: Library/files
> Thanks a lot. 
> Best regards, 
> Thibault



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to