mirror of
https://github.com/minio/mc.git
synced 2025-11-17 22:22:33 +03:00
Make default client type as Filesystem
This commit is contained in:
@@ -43,12 +43,14 @@ func (f *fsClient) Put(md5HexString string, size int64) (io.WriteCloser, error)
|
|||||||
}
|
}
|
||||||
objectDir, _ := filepath.Split(f.path)
|
objectDir, _ := filepath.Split(f.path)
|
||||||
objectPath := f.path
|
objectPath := f.path
|
||||||
|
if objectDir != "" {
|
||||||
if err := os.MkdirAll(objectDir, 0700); err != nil {
|
if err := os.MkdirAll(objectDir, 0700); err != nil {
|
||||||
err := iodine.New(err, nil)
|
err := iodine.New(err, nil)
|
||||||
r.CloseWithError(err)
|
r.CloseWithError(err)
|
||||||
blockingWriter.Release(err)
|
blockingWriter.Release(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
fs, err := os.Create(objectPath)
|
fs, err := os.Create(objectPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err := iodine.New(err, nil)
|
err := iodine.New(err, nil)
|
||||||
|
|||||||
@@ -41,13 +41,15 @@ func (f *fsClient) Put(md5HexString string, size int64) (io.WriteCloser, error)
|
|||||||
}
|
}
|
||||||
objectDir, _ := filepath.Split(f.path)
|
objectDir, _ := filepath.Split(f.path)
|
||||||
objectPath := f.path
|
objectPath := f.path
|
||||||
|
if objectDir != "" {
|
||||||
if err := os.MkdirAll(objectDir, 0700); err != nil {
|
if err := os.MkdirAll(objectDir, 0700); err != nil {
|
||||||
err := iodine.New(err, nil)
|
err := iodine.New(err, nil)
|
||||||
r.CloseWithError(err)
|
r.CloseWithError(err)
|
||||||
blockingWriter.Release(err)
|
blockingWriter.Release(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fs, err := os.Create(objectPath)
|
}
|
||||||
|
fs, err := os.Create(f.path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err := iodine.New(err, nil)
|
err := iodine.New(err, nil)
|
||||||
r.CloseWithError(err)
|
r.CloseWithError(err)
|
||||||
|
|||||||
@@ -23,9 +23,5 @@ func GetType(urlStr string) Type {
|
|||||||
return Object
|
return Object
|
||||||
}
|
}
|
||||||
|
|
||||||
if u.Scheme == "" {
|
|
||||||
return Filesystem
|
return Filesystem
|
||||||
}
|
|
||||||
|
|
||||||
return Unknown
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user