Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#763 closed Enhancement (fixed)

alertForRemainingDiskSpace should account for preallocated files

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


The mac client's Torrent method "alertForRemainingDiskSpace" estimates how much space is needed to download the rest of the torrent by looking at tr_stat.leftUntilDone, then checks to see if that much free space is available on the hard drive. However tr_stat.leftUntilDone gives the number of bytes left to be downloaded, not the number of bytes that need to be allocated on the disk. If part of a torrent has been preallocated on disk -- which is very common -- then this function can give out unnecessary warnings/errors.

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 (3)

comment:2 Changed 14 years ago by livings124

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

comment:3 Changed 14 years ago by livings124

  • Milestone changed from None Set to 1.10
Note: See TracTickets for help on using tickets.