> On Oct 12, 2015, at 11:01 AM, peter <commercial...@yahoo.de> wrote:
> 
> hi,
> 
> 
> the way file resume is implemented in DccFileReceive requires to user to 
> determine the file size manually and set _resumeOffset.
> wouldnt it make sene to just kill the last few bytes of the file and resume 
> it?
> 
> below is the current connectionMade method from:
> http://twistedmatrix.com/trac/browser/tags/releases/twisted-15.4.0/twisted/words/protocols/irc.py#L3013
>  
> <http://twistedmatrix.com/trac/browser/tags/releases/twisted-15.4.0/twisted/words/protocols/irc.py#L3013>
> 
> 
> replace this line:
> self.file.seek(self._resumeOffset)
> 
> with:
> self.file.seek(-3,2)
> 
> 
> which removes the last 3 bytes from the file end, 3 is just a guess.

Why remove the last 3 bytes?  It seems like either the file's contents are 
valid or not; if they are, just trust everything that's there, if not, don't 
try to resume...

Generally though this does sound like a good change!  Don't make the user guess 
if we can just do the right thing for them.  Can you open a ticket?

-glyph
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to