Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no clear way to close a CsvFileWriter #43

Open
mbdroid opened this issue Sep 3, 2015 · 1 comment
Open

There is no clear way to close a CsvFileWriter #43

mbdroid opened this issue Sep 3, 2015 · 1 comment

Comments

@mbdroid
Copy link

mbdroid commented Sep 3, 2015

After creating a CsvFileWriter and writing data to file there is no documented way to close the writer, resulting in a file descriptor leak. I've managed to close it by using writer.writeStream.end().

Example:

    writer = csv.createCsvFileWriter('file.csv', {'flags': 'a'});
    var csvData = new Array();
    csvData.push(id);
    csvData.push(name);
    writer.writeRecord(csvData);
    writer.writeStream.end(); // this is how to close the file descriptor
@seeya
Copy link

seeya commented Mar 25, 2017

Thanks for this, it helped. This should be included in the README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants