def truncate(self, filename, maxsize): file = open("F:/labOS/funner.dat", "r+") a = self.checkFileForPage(filename) b = int(a) offset = 0 page = b * 64 limit = page + maxsize t = 64 - maxsize trun = page + 64 while page in range(limit): file.seek(1) page += 1 offset += 1 while limit in range(trun): file.seek(limit * 16) self.myfile.writeToFile(" ", b, offset) limit += 1 offset += 16