fix: Files[io].writeAll does not create file unnecessarily. #3367 #3688
fix: Files[io].writeAll does not create file unnecessarily. #3367 #3688ankitkumarrain wants to merge 2 commits intotypelevel:mainfrom
Conversation
|
@mpilquist , Can you please review this code . |
|
@ankitkumarrain thanks for the PR. Before we review it would you mind making a contribution to our onboarding repository? Directions are in the README. https://github.com/typelevel/gsoc-onboarding Please review our AI policy and update your PR accordingly. |
|
@armanbilge Thanks for comment on this pull request .I have read AI policy and updated pull request Accordingly. Can you please review this pull request as i understand the code i have written. I visited to onboarding repository that was very fantastic i would really like to add my component there . Thank you for your time. |
|
Hi Ankit -- please be sure to complete the onboarding task first. Re: this PR, what's the behavior when writing an empty stream to a file? What's the desired behavior? |
Summary
Fixes #3667
Bug
writeAll used Stream.resource(writeCursor(...)) which eagerly opens
and creates the file during resource acquisition — before any bytes
are pulled from the input stream.
Fix
Use pull.stepLeg to peek at the input stream first:
Stepleg takes first chunk scpoe safely.
Files Changed