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

Delta Between Two Patch Sets: src/pkg/syscall/syscall_windows.go

Issue 6905057: code review 6905057: os: Improve the accuracy of os.Chtimes (Closed)
Left Patch Set: diff -r 6b602ab487d6 https://code.google.com/p/go Created 11 years, 3 months ago
Right Patch Set: diff -r ac06fe42df6d https://code.google.com/p/go Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/syscall/syscall_linux.go ('k') | src/pkg/syscall/types_linux.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Windows system calls. 5 // Windows system calls.
6 6
7 package syscall 7 package syscall
8 8
9 import ( 9 import (
10 "unicode/utf16" 10 "unicode/utf16"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) 444 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
445 if e != nil { 445 if e != nil {
446 return e 446 return e
447 } 447 }
448 defer Close(h) 448 defer Close(h)
449 a := NsecToFiletime(tv[0].Nanoseconds()) 449 a := NsecToFiletime(tv[0].Nanoseconds())
450 w := NsecToFiletime(tv[1].Nanoseconds()) 450 w := NsecToFiletime(tv[1].Nanoseconds())
451 return SetFileTime(h, nil, &a, &w) 451 return SetFileTime(h, nil, &a, &w)
452 } 452 }
453 453
454 const ImplementsUtimens = true 454 func UtimesNano(path string, ts []Timespec) (err error) {
455
456 func Utimens(path string, ts []Timespec) (err error) {
457 if len(ts) != 2 { 455 if len(ts) != 2 {
458 return EINVAL 456 return EINVAL
459 } 457 }
460 » pathp, e := utf16PtrFromString(path) 458 » pathp, e := UTF16PtrFromString(path)
461 if e != nil { 459 if e != nil {
462 return e 460 return e
463 } 461 }
464 h, e := CreateFile(pathp, 462 h, e := CreateFile(pathp,
465 FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, 463 FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,
466 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) 464 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
467 if e != nil { 465 if e != nil {
468 return e 466 return e
469 } 467 }
470 defer Close(h) 468 defer Close(h)
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 861
864 func (s Signal) String() string { 862 func (s Signal) String() string {
865 if 0 <= s && int(s) < len(signals) { 863 if 0 <= s && int(s) < len(signals) {
866 str := signals[s] 864 str := signals[s]
867 if str != "" { 865 if str != "" {
868 return str 866 return str
869 } 867 }
870 } 868 }
871 return "signal " + itoa(int(s)) 869 return "signal " + itoa(int(s))
872 } 870 }
LEFTRIGHT

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