tree_23.py 565 B

12345678910111213141516171819
  1. def truncate(self, filename, maxsize):
  2. file = open("F:/labOS/funner.dat", "r+")
  3. a = self.checkFileForPage(filename)
  4. b = int(a)
  5. offset = 0
  6. page = b * 64
  7. limit = page + maxsize
  8. t = 64 - maxsize
  9. trun = page + 64
  10. while page in range(limit):
  11. file.seek(1)
  12. page += 1
  13. offset += 1
  14. while limit in range(trun):
  15. file.seek(limit * 16)
  16. self.myfile.writeToFile(" ", b, offset)
  17. limit += 1
  18. offset += 16