Skip to content

Commit

Permalink
feat: add size operator to CloudFiles for HTTP interface
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed May 11, 2024
1 parent 560597e commit 84826ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloudfiles/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,10 @@ def head(self, file_path):
resp.raise_for_status()
return resp.headers

def size(self, file_path):
headers = self.head(file_path)
return int(headers["Content-Length"])

@retry
def get_file(self, file_path, start=None, end=None, part_size=None):
key = self.get_path_to_file(file_path)
Expand Down

0 comments on commit 84826ee

Please sign in to comment.