[Tutor] Corrupt files

geon geon at post.cz
Tue Aug 2 20:43:03 CEST 2005


Øyvind napsal(a):

>Hello.
>
>I have created a program that automatically downloads some files I need.
>It can be .zip, .jpg, .mpg or .txt. However, a lot of the time urlretrieve
>downloads the file, gives no error, but the downloaded file is corrupted.
>I use a simple check for the size of the file. If it is way too small, I
>automatically remove it. 
>

remove it and try to download it again, lets say , 3times until you get 
correct copy...

>The files are ok on the server.
>
>Is there some function/modulte that checks a files integrity wheter or not
>the file is corrupt or not?
>
>  
>

Until you are provided with, say, md5 checksum, there is no other way 
than comparing sizes, I think ...

-- 
geon




More information about the Tutor mailing list