cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-6872) File plugin: wrong disk space available on iOS
Date Wed, 04 Jun 2014 18:05:02 GMT

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

ASF GitHub Bot commented on CB-6872:
------------------------------------

GitHub user jcesarmobile opened a pull request:

    https://github.com/apache/cordova-plugin-file/pull/50

    fix for CB-6872

    This Pull Request fix CB-6872
    the free space available wasn't returning the right value, so when you request the file
system with a high value it fails with QUOTA_EXCEEDED_ERR
    https://issues.apache.org/jira/browse/CB-6872
    
    var requestBytes = 300 * 1024 * 1024; // 300MB
    window.requestFileSystem(LocalFileSystem.PERSISTENT, requestBytes, function(fs) {
                                     alert("success");
                                     }, function (e) {
                                     // error callback
                                     alert("error");
                                     });
    
    This code was failing on my ipod touch 32GB with 7+GB free, and now I can request the
7GB
    
    The problem is, checking the free space doesn't return the actual available free space
when you use the root path "/",
    you have to use another path instead, like self.rootDocsPath (documents folder path) to
get the actual free available space. I tried some other paths and all of them worked ("/var",
"/var/mobile/") but used self.rootDocsPath because it was already declared on the code so
I didn't have to hardcode a path.
    With paths like "/", "/etc" it returns the same wrong value.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jcesarmobile/cordova-plugin-file master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-file/pull/50.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #50
    
----
commit e551b78a181e2d34d8bc9fada98027e9728d9b26
Author: Julio CeĢsar <jcesarmobile@gmail.com>
Date:   2014-06-04T17:48:52Z

    changed fullPath to self.rootDocsPath
    
    checking the free space doesn't return the actual available free space,
    you have to use another path instead, like self.rootDocsPath

----


> File plugin: wrong disk space available on iOS
> ----------------------------------------------
>
>                 Key: CB-6872
>                 URL: https://issues.apache.org/jira/browse/CB-6872
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 3.4.0
>            Reporter: Alberto Pagliarini
>
> I have some issue on iOS trying to allocate more than 140 Mbytes with FIle plugin. I
have an iPad 16 Giga with 10 Giga free on device but a QUOTA_EXCEEDED_ERR was thrown
> Here the code
> {code}
> var requestBytes = 150 * 1024 * 1024;
> window.requestFileSystem(LocalFileSystem.PERSISTENT, requestBytes, function(fs) {
> 	// success callback
> }, function (e) {
>       // error callback
> });
> {code}
> I see that the free space calulated in {{requestFileSystem}} method of *CDVFile.m* results
always about 144 Mbytes.
> Link to thread on google groups
> https://groups.google.com/d/msg/phonegap/0er5Gp2c-gQ/bTvh15z24AkJ



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

Mime
View raw message