Giter VIP home page Giter VIP logo

Comments (7)

jmcnamara avatar jmcnamara commented on May 12, 2024

Hi,

The temp files aren't closed while the calling program is running since they may still be required for writing.

The Python version of the module has an undocumented facility to allow the user to close and if necessary re-open the temp files. This was to workaround a similar open file limit on Windows.

I'll look at adding something similar to libxlsxwriter.

John

from libxlsxwriter.

LaurinStrelow avatar LaurinStrelow commented on May 12, 2024

This sounds as a good solution. However at the moment the optimize files never get closed, even if the workbook gets closed or the worksheet freed and the file is not needed anymore.

from libxlsxwriter.

jmcnamara avatar jmcnamara commented on May 12, 2024

However at the moment the optimize files never get closed, even if the workbook gets closed or the worksheet freed and the file is not needed anymore.

Yes. There is that issue as well. I'll fix it in the next few days.

Is that the issue that you are having or are you also trying to generate a workbook with > 300 worksheets?

John

from libxlsxwriter.

LaurinStrelow avatar LaurinStrelow commented on May 12, 2024

Yes this was the issue i have. I make two workbooks with about 200 worksheets and the second workbook won't complete. But i think it is better to have the possibility to close the file and won't get near the file limit anytime later, if more worksheets are needed.

from libxlsxwriter.

jmcnamara avatar jmcnamara commented on May 12, 2024

Test case:

#include "xlsxwriter.h"

int main() {
    int i;
    lxw_workbook  *workbook;
    lxw_worksheet *worksheet;
    lxw_workbook_options options = {.constant_memory = 1};

    for (i = 0; i <= 5000; i++) {
        printf("File = %d\n", i);

        workbook  = new_workbook_opt("test.xlsx", &options);
        worksheet = workbook_add_worksheet(workbook, NULL);

        worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
        worksheet_write_number(worksheet, 1, 0, 123, NULL);

        workbook_close(workbook);
    }

    return 0;
}

from libxlsxwriter.

jmcnamara avatar jmcnamara commented on May 12, 2024

Hi,

I've pushed a fix to master for the tmpfile issue in constant_memory mode. You can try it when you get a chance.

You should open a second, feature request, issue for the extension to open/close the tempfiles during the life of the workbook, if you need that feature.

P.S. For iOS did you have to use downgrade the version of the zlib libraries as shown here?

John

from libxlsxwriter.

LaurinStrelow avatar LaurinStrelow commented on May 12, 2024

Hi,

thank you! This solves my issue. I will open another issue for the feature request.
I did not had to downgrade the zlib. The app has already mailcore installed via cocoapods, their binary includes minizip. Therefore i did not need to install minizip or take care of zlib. They are using the preinstalled library. However i needed to replace the zipOpenNewFileInZip4_64 with zipOpenNewFileInZip2 to get the linking done. This is sadly the only possibility i have.

from libxlsxwriter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.