mirror of https://github.com/rclone/rclone.git
gcs: fix directory marker code #3453
Use Update to upload the directory markers
This commit is contained in:
parent
baf16a65f0
commit
4023eaebe0
|
@ -897,7 +897,8 @@ func (f *Fs) createDirectoryMarker(ctx context.Context, bucket, dir string) erro
|
||||||
|
|
||||||
// Object to be uploaded
|
// Object to be uploaded
|
||||||
o := &Object{
|
o := &Object{
|
||||||
fs: f,
|
fs: f,
|
||||||
|
modTime: time.Now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
@ -917,7 +918,7 @@ func (f *Fs) createDirectoryMarker(ctx context.Context, bucket, dir string) erro
|
||||||
// Upload it if not
|
// Upload it if not
|
||||||
fs.Debugf(o, "Creating directory marker")
|
fs.Debugf(o, "Creating directory marker")
|
||||||
content := io.Reader(strings.NewReader(""))
|
content := io.Reader(strings.NewReader(""))
|
||||||
_, err = f.Put(ctx, content, o)
|
err = o.Update(ctx, content, o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("creating directory marker failed: %w", err)
|
return fmt.Errorf("creating directory marker failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue