Browse Source

Add support for directory creation

main
Quentin 9 months ago
parent
commit
1c8e981df7
  1. 2
      auth_ldap.go
  2. 12
      s3_fs.go

2
auth_ldap.go

@ -101,7 +101,7 @@ func (l *ldapConnector) profile() (*ldap.Entry, error) {
}
if len(sr.Entries) != 1 {
return nil, errors.New(fmt.Sprintf("Wrong number of LDAP entries, expected 1, got", len(sr.Entries)))
return nil, errors.New(fmt.Sprintf("Wrong number of LDAP entries, expected 1, got %d", len(sr.Entries)))
}
return sr.Entries[0], nil

12
s3_fs.go

@ -3,7 +3,10 @@ package main
import (
"context"
"errors"
"io"
"os"
"path"
"strings"
"time"
"github.com/minio/minio-go/v7"
@ -30,7 +33,14 @@ func NewS3FS(mc *minio.Client) S3FS {
func (s S3FS) Mkdir(ctx context.Context, name string, perm os.FileMode) error {
s.ctx = ctx
return errors.New("Not implemented Mkdir")
f, err := NewS3File(&s, path.Join(name, ".bagage"))
if err != nil {
return err
}
defer f.Close()
_, err = io.Copy(f, strings.NewReader("This is a placeholder"))
return nil
}
func (s S3FS) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error) {

Loading…
Cancel
Save