filer copy added uid/gid

This commit is contained in:
Chris Lu
2018-05-21 01:25:30 -07:00
parent f07482382b
commit 9dd228747c
10 changed files with 163 additions and 94 deletions

View File

@@ -71,13 +71,13 @@ func (f *Filer) CreateEntry(entry *Entry) (error) {
Attr: Attr{
Mtime: now,
Crtime: now,
Mode: os.ModeDir | 0660,
Mode: os.ModeDir | 0770,
Uid: entry.Uid,
Gid: entry.Gid,
},
}
glog.V(2).Infof("create directory: %s", dirPath)
glog.V(2).Infof("create directory: %s %v", dirPath, dirEntry.Mode)
mkdirErr := f.store.InsertEntry(dirEntry)
if mkdirErr != nil {
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr)

View File

@@ -6,12 +6,13 @@ import (
"time"
"path/filepath"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"strings"
)
type FullPath string
func NewFullPath(dir, name string) FullPath {
if dir == "/" {
if strings.HasSuffix(dir, "/") {
return FullPath(dir + name)
}
return FullPath(dir + "/" + name)