Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1383)

Issue 4984051: code review 4984051: os: os.RemoveAll has to check for 2 error codes on Wind... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by jp
Modified:
12 years, 8 months ago
Reviewers:
CC:
golang-dev, r2, brainman, rsc
Visibility:
Public.

Description

os: os.RemoveAll has to check for 2 error codes on Windows. ENOENT is not enough. os.Lstat can return ENOTDIR as well.

Patch Set 1 #

Patch Set 2 : diff -r 2a748f320ba5 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 2a748f320ba5 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 2a748f320ba5 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -13 lines) Patch
M src/pkg/os/file_posix.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/os/file_windows.go View 1 2 3 1 chunk +0 lines, -9 lines 0 comments Download
M src/pkg/os/path.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/syscall/mkerrors_windows.sh View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/syscall/zerrors_windows.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9
jp
Hello golang-dev@googlegroups.com (cc: alex.brainman@gmail.com, golang-dev@googlegroups.com, rsc@golang.org), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 8 months ago (2011-09-06 08:35:17 UTC) #1
r2
what's the difference between ENOENT and Errno(syscall.ERROR_FILE_NOT_FOUND)? it looks like the windows syscall code is ...
12 years, 8 months ago (2011-09-06 17:17:25 UTC) #2
rsc
ERROR_PATH_NOT_FOUND and ERROR_FILE_NOT_FOUND should turn into ENOENT in package syscall, so that higher level packages ...
12 years, 8 months ago (2011-09-07 18:11:29 UTC) #3
jp
Sounds like a right solution. Although it can be a bit tricky. ERROR_PATH_NOT_FOUND turns into ...
12 years, 8 months ago (2011-09-07 18:39:40 UTC) #4
brainman
On 2011/09/07 18:39:40, jp wrote: > > Although it can be a bit tricky. > ...
12 years, 8 months ago (2011-09-08 01:34:20 UTC) #5
jp
Alex, PTAL First, os.Lstat can return ENOTDIR even on Linux, so os.RemoveAll has to check ...
12 years, 8 months ago (2011-09-08 06:57:11 UTC) #6
brainman
LGTM. I am always happy with less code. Thank you.
12 years, 8 months ago (2011-09-08 07:25:24 UTC) #7
brainman
*** Submitted as http://code.google.com/p/go/source/detail?r=60d5fcd03b3b *** os: os.RemoveAll has to check for 2 error codes on ...
12 years, 8 months ago (2011-09-08 07:27:49 UTC) #8
jp
12 years, 8 months ago (2011-09-08 18:43:01 UTC) #9
I forget to upload ztypes_windows.go with ERROR_DIRECTORY removed

On 2011/09/08 07:27:49, brainman wrote:
> *** Submitted as http://code.google.com/p/go/source/detail?r=60d5fcd03b3b ***
> 
> os: os.RemoveAll has to check for 2 error codes on Windows. ENOENT is not
> enough.
> os.Lstat can return ENOTDIR as well.
> 
> R=golang-dev, r, alex.brainman
> CC=golang-dev, rsc
> http://codereview.appspot.com/4984051
> 
> Committer: Alex Brainman <mailto:alex.brainman@gmail.com>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b