Make filesys walk work.

This commit is contained in:
Jeffrey Regan
2019-11-25 16:55:50 -08:00
committed by jregan
parent cb64e19da3
commit c722d4cd17
15 changed files with 1369 additions and 443 deletions

View File

@@ -12,14 +12,14 @@ var _ os.FileInfo = fileInfo{}
// fileInfo implements os.FileInfo for a fileInMemory instance.
type fileInfo struct {
*fileInMemory
node *fsNode
}
// Name returns the name of the file
func (fi fileInfo) Name() string { return fi.name }
func (fi fileInfo) Name() string { return fi.node.Name() }
// Size returns the size of the file
func (fi fileInfo) Size() int64 { return int64(len(fi.content)) }
func (fi fileInfo) Size() int64 { return fi.node.Size() }
// Mode returns the file mode
func (fi fileInfo) Mode() os.FileMode { return 0777 }
@@ -28,7 +28,7 @@ func (fi fileInfo) Mode() os.FileMode { return 0777 }
func (fi fileInfo) ModTime() time.Time { return time.Time{} }
// IsDir returns true if it is a directory
func (fi fileInfo) IsDir() bool { return fi.dir }
func (fi fileInfo) IsDir() bool { return fi.node.isNodeADir() }
// Sys should return underlying data source, but it now returns nil
func (fi fileInfo) Sys() interface{} { return nil }