mirror of
https://github.com/minio/minio.git
synced 2025-11-23 19:17:43 -05:00
Creating subdirectories in fs now works
This commit is contained in:
@@ -176,6 +176,13 @@ func (storage *storage) StoreObject(bucket string, key string, data io.Reader) e
|
||||
|
||||
// get object path
|
||||
objectPath := path.Join(storage.root, bucket, key)
|
||||
objectDir := path.Dir(objectPath)
|
||||
if _, err := os.Stat(objectDir); os.IsNotExist(err) {
|
||||
err = os.MkdirAll(objectDir, 0700)
|
||||
if err != nil {
|
||||
return mstorage.EmbedError(bucket, key, err)
|
||||
}
|
||||
}
|
||||
|
||||
// check if object exists
|
||||
if _, err := os.Stat(objectPath); !os.IsNotExist(err) {
|
||||
|
||||
Reference in New Issue
Block a user