English 中文(简体)
对于能够恢复档案转让的同侪对同侪评估而言,在恢复档案之前检查档案/更改变更日期是否足够?
原标题:For a peer-to-peer app that can resume file transfers, is it sufficient to check filesize/modified date for changes before resuming a file?

I m从事网络化申请工作,有同行档案传输部分(即时投递员),因此,我能够以宽松的方式恢复档案转让。

If there is an ongoing file transfer, and one user drops out, the recipient still knows how much of the file he s successfully received and therefore where to resume the transfer from. However, if the file has changed in the meantime, how can this be detected? With regards to my questions, I m not focused here on corruption by the network so much as corruption by the source file being altered.

我开始这样做的方式是,在寄出档案之前,让发人洗手,因此,收受人有一只洗衣机对结案进行检查。 然而,这只是发现腐败现象,除非每一方还恢复过头。 可以通过把档案放在地库中来缓解这一问题,并逐个.。 然而,洗衣的最大问题是,它需要真正、真正长期的时间,当用户想立即发送某种东西时,这只是一种不良的用户经验(Ex. :关于网络份额缓慢的ISO是寄出的档案)。

I was thinking about changing to simply checking the file size and modified date each time a transfer begins or is resumed. While this is clearly not foolproof, unless I m missing something (and please correct me if I am), almost every means an end-user would be using to alter files will be well-behaved and at the very least mark the modified date, and even if not, the change in size should catch 99% of cases. Does this seem like an acceptable compromise? Bad idea?

How do the established protocols handle this?

最佳回答

The quick answer to your question is that it will work in most cases, unless files are modified often.

Instead of hashes, use check sums (CRC32 for example). These are much faster to check whether a file has been modified.

如果连接中断,你只需要将计算出来的chu重新发回源头,以补偿当前chu是否在两者之间进行过修改。 然后,它可以决定由谁来改造和运送失踪的棚户。

Chunk &eckums are the Best tradeoff over full file and hashes regardinguser experiences.

问题回答

暂无回答




相关问题
C# copy image form PowerPoint to Word

I need a application to copy text and images form PowerPoint to Word. I use this libraries: Microsoft.Office.Interop.PowerPoint and Microsoft.Office.Interop.Word. The text s easy to transfer, but ...

Atomic file copy under .NET

I am building a server app that copies files using System.IO.File.Copy(...) function. My files can be rather large, therefore, it has a fair chance that if the machine crashes, it happens during ...

Transfer file over socket

I found this code witch I tried and it works great but(!). I want to store the file in a folder that I will choose and also get it from a folder that I again will chose. Since the Sender get an ...

Java File Transfer getting stuck halfway

I am trying to send a file (an image sent as a byte array) with the client and then the server should receive said byte array to make further use of it. However when I click on the "send" to send the ...

Java: BufferedReader reads more than a line?

I m making a program in Java with Sockets. I can send commands to the client and from the client to the server. To read the commands I use a BufferedReader. To write them, a PrintWriter But now I want ...

热门标签