Commit e85a0ceb by rfkelly0

S3FS.get_total_size: take optional path parameter

parent edb57234
...@@ -575,9 +575,10 @@ class S3FS(FS): ...@@ -575,9 +575,10 @@ class S3FS(FS):
self.copy(src,dst,overwrite=overwrite) self.copy(src,dst,overwrite=overwrite)
self._s3bukt.delete_key(self._s3path(src)) self._s3bukt.delete_key(self._s3path(src))
def get_total_size(self): def get_total_size(self,path=""):
"""Get total size of all files in this FS.""" """Get total size of all files in this FS."""
return sum(k.size for k in self._s3bukt.list(prefix=self._prefix)) prefix = self._s3path(path)
return sum(k.size for k in self._s3bukt.list(prefix=prefix))
def _eq_utf8(name1,name2): def _eq_utf8(name1,name2):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment