Patent ID: 7296043

Claim:
A method for adjusting a size of a file having a total number of empty pages, said method comprising: (a) starting a traversal of said file at a last page of said file and progressing toward a first page of said file; (b) indicating an encountered page as skipped if said encountered page is empty; (c) indicating said encountered page as dirty if said encountered page is non-empty; (d) subsequent to acts (b) and (c), comparing a sum of skipped pages plus dirty pages to the total number of empty pages in said file; if said sum is less than said total number of empty pages, traversing said file to a next page and performing acts (b), (c), and (d); if said sum is greater than or equal to said total number of empty pages: writing contents of said dirty pages to empty pages of said file that have not been traversed; and indicating each dirty page and each skipped page as unallocated; and truncating said unallocated pages from said file.