From cb9f1eefd24e9a4d15cdee4e27396b4d773a00a9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 6 Dec 2016 15:13:29 +0000 Subject: [PATCH] crypt: fix Mkdir/Rmdir with a dir parameter - fixes rmdirs command --- crypt/crypt.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crypt/crypt.go b/crypt/crypt.go index 18c379163..4bc8136dd 100644 --- a/crypt/crypt.go +++ b/crypt/crypt.go @@ -152,6 +152,20 @@ func (f *Fs) Hashes() fs.HashSet { return fs.HashSet(fs.HashNone) } +// Mkdir makes the directory (container, bucket) +// +// Shouldn't return an error if it already exists +func (f *Fs) Mkdir(dir string) error { + return f.Fs.Mkdir(f.cipher.EncryptDirName(dir)) +} + +// Rmdir removes the directory (container, bucket) if empty +// +// Return an error if it doesn't exist or isn't empty +func (f *Fs) Rmdir(dir string) error { + return f.Fs.Rmdir(f.cipher.EncryptDirName(dir)) +} + // Purge all files in the root and the root directory // // Implement this if you have a way of deleting all the files