@@ -58,7 +58,7 @@ func bitsToDrives(bitmap uint32) []string {
5858 var drive rune = 'a'
5959 var drives []string
6060
61- for bitmap != 0 {
61+ for bitmap != 0 && drive <= 'z' {
6262 if bitmap & 1 == 1 {
6363 drives = append (drives , string (drive )+ ":" )
6464 }
@@ -128,7 +128,7 @@ func (f *winRoot) Readdir(n int) ([]os.FileInfo, error) {
128128}
129129
130130func (f * winRoot ) Stat () (os.FileInfo , error ) {
131- return nil , os . ErrPermission
131+ return rootFileInfo , nil
132132}
133133func (f * winRoot ) ReadAt (b []byte , off int64 ) (int , error ) {
134134 return 0 , os .ErrPermission
@@ -149,6 +149,7 @@ func (f *winRoot) Chown(uid, gid int) error {
149149 return os .ErrPermission
150150}
151151func (f * winRoot ) Close () error {
152+ f .drives = nil
152153 return nil
153154}
154155
@@ -160,20 +161,21 @@ func (s *Server) openfile(path string, flag int, mode fs.FileMode) (file, error)
160161}
161162
162163type winRootFileInfo struct {
163- fs. FileInfo
164- name string
164+ name string
165+ modTime time. Time
165166}
166167
167- func (w winRootFileInfo ) Name () string { return w .name }
168- func (w winRootFileInfo ) Size () int64 { return 0 }
169- func (w winRootFileInfo ) Mode () fs.FileMode { return fs .ModeDir | 0555 } // read+execute for all
170- func (w winRootFileInfo ) ModTime () time.Time { return time. Time {} }
171- func (w winRootFileInfo ) IsDir () bool { return true }
172- func (w winRootFileInfo ) Sys () interface {} { return nil }
168+ func (w * winRootFileInfo ) Name () string { return w .name }
169+ func (w * winRootFileInfo ) Size () int64 { return 0 }
170+ func (w * winRootFileInfo ) Mode () fs.FileMode { return fs .ModeDir | 0555 } // read+execute for all
171+ func (w * winRootFileInfo ) ModTime () time.Time { return w . modTime }
172+ func (w * winRootFileInfo ) IsDir () bool { return true }
173+ func (w * winRootFileInfo ) Sys () interface {} { return nil }
173174
174175// Create a new root FileInfo
175- var rootFileInfo = winRootFileInfo {
176- name : "/" ,
176+ var rootFileInfo = & winRootFileInfo {
177+ name : "/" ,
178+ modTime : time .Now (),
177179}
178180
179181func (s * Server ) lstat (name string ) (os.FileInfo , error ) {
0 commit comments