mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Avoid showing the first directory when listing the root directory
This commit is contained in:
parent
3ee017d350
commit
e378f9892d
|
@ -26,8 +26,7 @@ type DirectoryManagerInMap struct {
|
|||
}
|
||||
|
||||
func (dm *DirectoryManagerInMap) NewDirectoryEntryInMap(parent *DirectoryEntryInMap, name string) (d *DirectoryEntryInMap) {
|
||||
d = &DirectoryEntryInMap{Name: name, Parent: parent}
|
||||
d.SubDirectories = make(map[string]*DirectoryEntryInMap)
|
||||
d = &DirectoryEntryInMap{Name: name, Parent: parent, SubDirectories: make(map[string]*DirectoryEntryInMap)}
|
||||
dm.max++
|
||||
d.Id = dm.max
|
||||
parts := make([]string, 0)
|
||||
|
@ -53,7 +52,8 @@ func (dm *DirectoryManagerInMap) log(words ...string) {
|
|||
|
||||
func NewDirectoryManagerInMap(dirLogFile string) (dm *DirectoryManagerInMap, err error) {
|
||||
dm = &DirectoryManagerInMap{}
|
||||
dm.Root = dm.NewDirectoryEntryInMap(nil, "")
|
||||
//dm.Root do not use NewDirectoryEntryInMap, since dm.max will be changed
|
||||
dm.Root = &DirectoryEntryInMap{SubDirectories: make(map[string]*DirectoryEntryInMap)}
|
||||
if dm.logFile, err = os.OpenFile(dirLogFile, os.O_RDWR|os.O_CREATE, 0644); err != nil {
|
||||
return nil, fmt.Errorf("cannot write directory log file %s.idx: %s", dirLogFile, err.Error())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue