Add option to emulate `--create-empty-src-dirs` with s3 remotes
D
DW
Currently, two-way sync with an s3 bucket on one end will remove all empty folders from both endpoints (eventually---it make take a few roundtrips to converge). I'd prefer a sync that faithfully mirrors the file and folder hierarchy including empty folders, as accomplished by using rclone's
--create-empty-src-dirs
, even when the remote is an s3 bucket.This may also be relevant for copy and one-way sync, as they also support this flag. I just haven't investigated the current behavior of those modes.
D
DW
Having tested some more, it seems like
--create-empty-src-dirs
is actually enabled and works just like you'd expect with SFTP remotes. It's just that s3 storage doesn't actually have a concept of folders, and the various ways of emulating them aren't portable across providers, so S3drive doesn't try.So I'll adjust the feature request as follows: Add transparent emulation of empty folders on s3 storage, at least when the remote is S3drive's own storage. Currently, when you create an empty folder on the remote, it's emulated via a hidden, empty
.blank
file, but if you bisync with a local folder and delete that file locally, the folder will vanish on the remote and be deleted locally on the next sync. Ideally, S3drive would be smart enough to skip creating this file locally, while maintaining it on the remote, even if the S3 bucket is wrapped in a crypt.Edited the original post to reflect this.