-
Notifications
You must be signed in to change notification settings - Fork 18k
os: avoid creating a new file in Truncate on Windows #59085
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
Conversation
This PR (HEAD: 2f22f43) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/477215 to see it. Tip: You can toggle comments from me using the |
Message from Quim Muntal: Patch Set 1: Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Quim Muntal: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Gopher Robot: Patch Set 1: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Bryan Mills: Patch Set 1: Code-Review+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
2f22f43
to
9600f6c
Compare
This PR (HEAD: 9600f6c) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/477215 to see it. Tip: You can toggle comments from me using the |
Message from Thanonchai W: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
9600f6c
to
b7b06e0
Compare
This PR (HEAD: b7b06e0) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/477215 to see it. Tip: You can toggle comments from me using the |
Message from Thanonchai W: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Bryan Mills: Patch Set 2: Code-Review+1 (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
b7b06e0
to
a95af92
Compare
This PR (HEAD: a95af92) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/477215 to see it. Tip: You can toggle comments from me using the |
Message from Thanonchai W: Patch Set 3: (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Message from Ian Lance Taylor: Patch Set 5: Auto-Submit+1 Code-Review+2 Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Gopher Robot: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Bryan Mills: Patch Set 5: Code-Review+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Gopher Robot: Patch Set 5: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Truncate() a non existent file on Windows currently creates a new blank file. This behavior is not consistent with other OSes where a file not found error would instead be returned. This change makes Truncate on Windows return a file-not-found error when the specified file doesn't exist, bringing the behavior consistent. New test cases have been added to prevent a regression. Fixes 58977
a95af92
to
636b6c3
Compare
This PR (HEAD: 636b6c3) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/477215 to see it. Tip: You can toggle comments from me using the |
Message from Thanonchai W: Patch Set 6: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Quim Muntal: Patch Set 6: Code-Review+2 Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Gopher Robot: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Message from Gopher Robot: Patch Set 6: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/477215. |
Truncate() a non existent file on Windows currently creates a new blank file. This behavior is not consistent with other OSes where a file not found error would instead be returned. This change makes Truncate on Windows return a file-not-found error when the specified file doesn't exist, bringing the behavior consistent. New test cases have been added to prevent a regression. Fixes #58977 Change-Id: Iaf7b41fc4ea86a2b2ccc59f8be81be42ed211b5c GitHub-Last-Rev: 636b6c3 GitHub-Pull-Request: #59085 Reviewed-on: https://go-review.googlesource.com/c/go/+/477215 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Quim Muntal <[email protected]> Run-TryBot: Quim Muntal <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
This PR is being closed because golang.org/cl/477215 has been merged. |
Truncate() a non existent file on Windows currently creates a new blank
file. This behavior is not consistent with other OSes where a file not
found error would instead be returned. This change makes Truncate on
Windows return a file-not-found error when the specified file doesn't
exist, bringing the behavior consistent.
New test cases have been added to prevent a regression.
Fixes #58977