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

Delta Between Two Patch Sets: src/pkg/os/stat_mingw.go

Issue 770041: code review 770041: syscall: implementing some mingw syscalls required by o... (Closed)
Left Patch Set: Created 14 years ago
Right Patch Set: code review 770041: syscall: implementing some mingw syscalls required by o... Created 14 years 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/os/file.go ('k') | src/pkg/os/sys_mingw.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 package os 5 package os
6 6
7 import "syscall" 7 import "syscall"
8 8
9 func isSymlink(stat *syscall.Stat_t) bool { 9 func isSymlink(stat *syscall.Stat_t) bool {
10 » return stat.Mode&syscall.S_IFMT == syscall.S_IFLNK 10 » panic("windows isSymlink not implemented")
11 } 11 }
12 12
13 func dirFromStat(name string, dir *Dir, lstat, stat *syscall.Stat_t) *Dir { 13 func dirFromStat(name string, dir *Dir, lstat, stat *syscall.Stat_t) *Dir {
14 » dir.Dev = uint64(stat.Dev) 14 » panic("windows dirFromStat not implemented")
15 » dir.Ino = uint64(stat.Ino)
16 » dir.Nlink = uint64(stat.Nlink)
17 » dir.Mode = stat.Mode
18 » dir.Uid = stat.Uid
19 » dir.Gid = stat.Gid
20 » dir.Rdev = uint64(stat.Rdev)
21 » dir.Size = uint64(stat.Size)
22 » dir.Blksize = uint64(stat.Blksize)
23 » dir.Blocks = uint64(stat.Blocks)
24 » dir.Atime_ns = uint64(stat.Atime) * 1e9
25 » dir.Mtime_ns = uint64(stat.Mtime) * 1e9
26 » dir.Ctime_ns = uint64(stat.Ctime) * 1e9
27 » for i := len(name) - 1; i >= 0; i-- {
28 » » if name[i] == '/' {
29 » » » name = name[i+1:]
30 » » » break
31 » » }
32 » }
33 » dir.Name = name
34 » if isSymlink(lstat) && !isSymlink(stat) {
35 » » dir.FollowedSymlink = true
36 » }
37 » return dir
38 } 15 }
LEFTRIGHT

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