You will be aided greatly by a person whom you thought to be unimportant.
FrontPage › UploadFile › HelloWorld › FileSpilt
Difference between r1.1 and the current
@@ -5,7 +5,7 @@
_10MB = 1024 * 1024 * 10count = 1
filesize = os.path.getsize('d://chobocho//56MB.z')
filesize = os.path.getsize('c://chobocho//data.img')
print filesize
@@ -39,7 +39,7 @@
print filesizecount = 1
target_file = open('d://chobocho//56MB.zip',"wb")
target_file = open('c://chobocho//data.img',"wb")
while ( 1 ) :
source_filename = "target_" + str(count)
@@ -52,9 +52,8 @@
target_file.write(data)print source_filename
print filesize
break
target_file.close()}}}
Spilt
import os _10MB = 1024 * 1024 * 10 count = 1 filesize = os.path.getsize('c://chobocho//data.img') print filesize source_file = open('d://chobocho//56MB.z',"rb") while ( filesize > 0 ) : if ( filesize >= _10MB): data = source_file.read(_10MB) filesize -= _10MB else: data = source_file.read(filesize) filesize = 0 target_filename = "target_" + str(count) count += 1; target_file = open(target_filename, "wb"); target_file.write("My data!") target_file.write(data) target_file.close() source_file.close()
Join
import os _10MB = 1024 * 1024 * 10 filesize = _10MB print filesize count = 1 target_file = open('c://chobocho//data.img',"wb") while ( 1 ) : source_filename = "target_" + str(count) filesize = os.path.getsize(source_filename) source_file = open(source_filename,"rb") source_file.seek(8) data = source_file.read(filesize-8) count += 1; source_file.close() target_file.write(data) print source_filename print filesize if ( filesize < _10MB + 8 ): break target_file.close()