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

OutputStreamWriter is always run with WRITE operation #24

Closed
danielGz opened this issue Aug 31, 2018 · 5 comments
Closed

OutputStreamWriter is always run with WRITE operation #24

danielGz opened this issue Aug 31, 2018 · 5 comments
Milestone

Comments

@danielGz
Copy link

OutputStreamWriter is always run with WRITE option so the file content gets replaced everytime.

@mithutokder
Copy link

Any fix for this?
CsvWriter should provide option for amend and create new file

@osiegmar
Copy link
Owner

I will consider this as part of an API overhaul. But for now, you could simply to this to append to a file:

File file = new File("/tmp/foo");

CsvWriter csvWriter = new CsvWriter();
try (CsvAppender append = csvWriter.append(new FileWriter(file, true))) {
    append.appendLine("a", "b");
}

@mithutokder
Copy link

Thanks for the reply & the workaround. But, the name method name 'append' is bit confusing.
Any plan to work on it?
The writer should provide method for creating new file & appending to existing file.

@michael-martinez
Copy link

+1 the method name is really confusing could you please rename the append method and provide a proper append method with the workaround you provided on master branch? I guess a lot of API users will lose some time on this.

@osiegmar osiegmar added this to the 2.0 milestone Nov 4, 2020
@osiegmar
Copy link
Owner

osiegmar commented Nov 4, 2020

Will be handled in 2.0 - see

@osiegmar osiegmar closed this as completed Jan 1, 2021
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

4 participants