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

Close open files on caller side #309

Closed
wants to merge 2 commits into from

Conversation

iamazeem
Copy link
Collaborator

@iamazeem iamazeem commented Nov 28, 2024

Signed-off-by: Azeem Sajid [email protected]

@iamazeem iamazeem added the bug Something isn't working label Nov 28, 2024
@iamazeem iamazeem self-assigned this Nov 28, 2024
@iamazeem iamazeem requested a review from liquidaty November 28, 2024 07:05
@iamazeem
Copy link
Collaborator Author

@liquidaty: Please review and merge. Thanks!

@liquidaty
Copy link
Owner

@iamazeem thank you, this is helpful in pointing out all the current areas that need fixing and proposing a solution. The only reason we are not merging this right away is that we will likely pursue an alternate solution which would be for the writer options to have output_filename that could be used instead of stream, whereby in zsv_writer_new(), if output_filename is specified then stream would be opened there, in which case it would also be closed by zsv_writer_delete().

@iamazeem
Copy link
Collaborator Author

@liquidaty: Makes sense. 👍
However, without it, the commands with missing fclose won't work in playground.
The flushing is not being done in this case.

Also, the above solution would work the same for commands such as 2json, 2db, etc. where the writing is not CSV format? 🤔
How is the non-CSV format going to be encapsulated?

IMO, it may be done incrementally i.e. merge this one first and then iterate with the new solution.

@liquidaty
Copy link
Owner

Superseded by #310

@liquidaty liquidaty closed this Nov 29, 2024
@iamazeem iamazeem deleted the close-open-files-on-caller-side branch November 29, 2024 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants