Re: Bittorrent and filesystem API / integration
Nick Johnson <[email protected]>
| Newsgroups | gmane.network.bit-torrent.general |
|---|---|
| Message-ID | <[email protected]> |
Jesus Cea wrote:
>Nick Johnson wrote:
>
>
>>For example, you could, when allocating files, create a temporary
>>(hidden) file in the same directory that contains the bitmap for the
>>torrent. Before starting, check the mtime on the bitmap file is at least
>>as recent as the most recent of the torrent files, and if so, use it
>>instead of hashing the whole thing manually.
>>
>>
>
>All these schemas fails if you have a power surge and the OS "write"
>operation is asyncronous, like any modern Operating System.
>
>
No, that's why I stated that you should check the mtime of the bitmap
versus the files it concerns before starting. As long as the program
ensures it flushes its buffers for the files before writing the updated
bitmap, you know that if the bitmap is newer than the files, it is valid.
Databases do this all the time with transaction logs just fine.
-Nick Johnson
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/