looks good except that Readdirnames is doing all the work for Readdir and then throwing ...
14 years, 11 months ago
(2010-04-07 06:11:42 UTC)
#2
looks good except that Readdirnames is doing
all the work for Readdir and then throwing it away.
it seems like on Windows Readdir should be the
main loop and Readdirnames should be a wrapper
that throws away the *Dir structs, the opposite of
the situation on Unix.
http://codereview.appspot.com/851045/diff/2001/3011
File src/pkg/utf16/utf16.go (right):
http://codereview.appspot.com/851045/diff/2001/3011#newcode76
src/pkg/utf16/utf16.go:76: // DecodeZeroTerminated returns the Unicode code
point sequence
This is a completely copy of Decode.
At the least it should be
for i, v := range s {
if v == 0 {
return Decode(s[0:i])
}
}
return Decode(s)
Also I don't believe it belongs here.
This is very specific to system calls and belongs
in the syscall code.
Hi Alex. This looks good but unfortunately we've renamed os.Dir to the more obvious os.FileInfo. ...
14 years, 11 months ago
(2010-04-11 20:56:07 UTC)
#4
Hi Alex. This looks good but unfortunately we've
renamed os.Dir to the more obvious os.FileInfo.
Could you please update this code with the new names?
Sorry for the delay - I got stuck in a bunch of panic and
recover-related bugs last week.
Thanks.
Russ
http://codereview.appspot.com/851045/diff/13/7007
File src/pkg/syscall/syscall_mingw.go (right):
http://codereview.appspot.com/851045/diff/13/7007#newcode57
src/pkg/syscall/syscall_mingw.go:57: // UTF16ToString returns the UTF-8 encoding
of the UTF-16 sequence s,
Is this still used?
It seems odd to have both UTF16ToString
and the new ZeroTerminatedUTF16ToString
since both are trying to handle 0 code points,
just slightly differently. Maybe the new code
should be named UTF16ToString and this
one should just go away?
> we've > renamed os.Dir to the more obvious os.FileInfo. > Could you please update ...
14 years, 11 months ago
(2010-04-12 00:43:09 UTC)
#5
> we've
> renamed os.Dir to the more obvious os.FileInfo.
> Could you please update this code with the new names?
Will do, no problem.
http://codereview.appspot.com/851045/diff/13/7007
File src/pkg/syscall/syscall_mingw.go (right):
http://codereview.appspot.com/851045/diff/13/7007#newcode57
src/pkg/syscall/syscall_mingw.go:57: // UTF16ToString returns the UTF-8 encoding
of the UTF-16 sequence s,
> Is this still used?
It does. See syscall.Errstr()
> It seems odd to have both UTF16ToString
> and the new ZeroTerminatedUTF16ToString
> since both are trying to handle 0 code points,
> just slightly differently. Maybe the new code
> should be named UTF16ToString and this
> one should just go away?
>
You are correct in a way. They do the same thing, but differently.
ZeroTerminatedUTF16ToString have to find 0 without any extra info, while
UTF16ToString, in the context where it is used, get told where the 0 is (see
http://msdn.microsoft.com/en-us/library/ms679351%28VS.85%29.aspx).
I should, probably, investigate situation further.
*** Submitted as http://code.google.com/p/go/source/detail?r=b1fb8f7bb06b *** os: mingw version of Readdir() and Stat() implemented R=rsc CC=golang-dev ...
14 years, 11 months ago
(2010-04-13 23:30:13 UTC)
#8
Issue 851045: code review 851045: os: mingw version of Readdir() and Stat() implemented
(Closed)
Created 14 years, 11 months ago by brainman
Modified 14 years, 10 months ago
Reviewers:
Base URL:
Comments: 3