Opened 14 years ago

Closed 14 years ago

#762 closed Enhancement (invalid)

mac file space check doesn't take preallocated files into account

Reported by: charles Owned by: livings124
Priority: Normal Milestone: None Set
Component: Mac Client Version: 1.06
Severity: Normal Keywords:


Torrent.m's method "alertForRemainingDiskSpace" seems to have an error in it. That method estimates that the space needed to download the rest of the torrent is tr_stat.leftUntilDone, and checks to make sure that much free space is left on the hard drive. The problem is that tr_stat.leftUntilDone measures the number of bytes left to be downloaded, not the number of bytes left to be allocated on the disk -- if some of a torrent has been preallocated, it's possible for a torrent to download even if tr_stat.leftUntilDone is less than the free disk space.

Possible solution: instead of using tr_stat.leftUntilDone, take the sum of the space allocated to each file in the torrent. This can be done by walking tr_info.files and using the Cocoa equivalent of stat() to find out how much disk space has been allocated to the file.

This ticket is related to

Change History (1)

comment:1 Changed 14 years ago by charles

  • Resolution set to invalid
  • Status changed from new to closed

Looks like I hit the 'submit' button instead of 'preview'. This is a duplicate of #763.

Note: See TracTickets for help on using tickets.