Skip to content

Commit

Permalink
Remove references to deprecated get_size() getter
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhi committed Mar 3, 2024
1 parent c4d4fe6 commit 45a1128
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyfatfs/FatIO.py
Expand Up @@ -75,7 +75,7 @@ def seek(self, offset: int, whence: int = 0) -> int:
if whence == 1:
offset += self.__bpos
elif whence == 2:
offset += self.dir_entry.get_size()
offset += self.dir_entry.filesize
elif whence != 0:
raise ValueError(f"Invalid whence {whence}, should be 0, 1 or 2")

Expand Down Expand Up @@ -226,11 +226,11 @@ def truncate(self, size: Optional[int] = 0) -> int:
f"size limitations.",
errno=errno.E2BIG)

if size > self.dir_entry.get_size():
if size > self.dir_entry.filesize:
self.seek(0, 2)
self.__write(b'\0' * (size - self.dir_entry.get_size()))
self.__write(b'\0' * (size - self.dir_entry.filesize))
self.seek(cur_pos)
elif size < self.dir_entry.get_size():
elif size < self.dir_entry.filesize:
# Always keep at least one cluster allocated
num_clusters = max(1, self.fs.calc_num_clusters(size))
i = 0
Expand Down

0 comments on commit 45a1128

Please sign in to comment.