Skip to content

Commit

Permalink
models:file - add get_size method to get and update file size
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Oct 31, 2023
1 parent 103cd95 commit 48f18e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def get_checksum(self) -> str:
self.checksum = file_checksum(self.get_absolute_path(self.root))
return self.checksum

def get_size(self) -> int:
self.size = self.get_absolute_path(self.root).stat().st_size
return self.size

@property
def name(self) -> str:
"""
Expand Down

0 comments on commit 48f18e0

Please sign in to comment.