[ https://issues.apache.org/jira/browse/CB-2787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13749650#comment-13749650 ]
Cho commented on CB-2787: ------------------------- Sorry, doesn't check my secondary mail that frequent. Finally some news from here huh.. I think I attached the log from very beginning. Maybe at the forum. It does look like the same produced by Andrew. Out of curiosity, how can I have these fixes? I do able to get around with only ONE line of code.. (SERIOUSLY).. By luck though.. Sorry I doesn't tell about this solution before this, as not one really go and check and I fed up. Here is the small snippet. var ft = new FileTransfer(); ft.download(sorceURI, targetURI, function(entry){ //call your own function. // the magic line entry = null; }); the error gone and succeed with all the download. (My apps required to download 1000+ of file).. Tested :) hope this help. > PhoneGap FileTransfer.Download more than 300 files > -------------------------------------------------- > > Key: CB-2787 > URL: https://issues.apache.org/jira/browse/CB-2787 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 2.5.0 > Reporter: Cho > Assignee: Ian Clelland > > I had tried to download more than 300 files and then it hit error after that. > Seems like some IO Connection was not properly closed. I wrote a small code > to test it out. > Any idea? How to file a report or get a source of phonegap to check the real > cause? > {code} > var counter = 500; > function DownloadFile() { > if (counter == 0) { > DownloadComplete(); > return; > } > var ft = new FileTransfer(); > var downloadUrl = "<source>"; > var dlPath = "<target>" > ft.download(downloadUrl, dlPath, function(entry) { > counter--; > UpdateProgress(); > DownloadFile(); > }, function(error) { > DownloadFailed(); > }, true); > } > {code} > note: <target> and <source> is alright because it was it failed when the > counter goes until 300+. > {code} > 03-14 08:35:09.706: E/FileTransfer(24867): > {"target":"<target>","source":"<source>","http_status":200,"code":1} > 03-14 08:35:09.706: E/FileTransfer(24867): java.io.FileNotFoundException: > <source>: open failed: EMFILE (Too many open files) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.IoBridge.open(IoBridge.java:416) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.io.FileOutputStream.<init>(FileOutputStream.java:88) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.io.FileOutputStream.<init>(FileOutputStream.java:73) > 03-14 08:35:09.706: E/FileTransfer(24867): at > org.apache.cordova.FileTransfer$4.run(FileTransfer.java:685) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) > 03-14 08:35:09.706: E/FileTransfer(24867): at > java.lang.Thread.run(Thread.java:856) > 03-14 08:35:09.706: E/FileTransfer(24867): Caused by: > libcore.io.ErrnoException: open failed: EMFILE (Too many open files) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.Posix.open(Native Method) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) > 03-14 08:35:09.706: E/FileTransfer(24867): at > libcore.io.IoBridge.open(IoBridge.java:400) > 03-14 08:35:09.706: E/FileTransfer(24867): ... 6 more > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira