|
From: Lauri L. <pu...@su...> - 2005-02-17 15:19:19
|
Hi,
I just noticed this, when I have this kind of code:
---
def copyFile(filename):
bi = open(filename)
bo = open(filename+'.copy', 'w')
b = 1000000
while 1:
l = bi.read(b)
if len(l) == 0:
break
bo.write(l)
bo.close()
bi.close()
return 1
i = raw_input("Give file:")
copyFile(i)
---
and e.g. copy mp3 file with it the .copy mp3 file is somehow mixed and
not working as it should, but when I run this with plain python it works
just as it should. How to fix or workaround this? Is thus known bug?
I have tried to make the same using java's FileInputStream and
FileOutputStream but then the performance is then very bad (about
500kB/s). Is that also known issue?
Sincerely,
Lauri Lehtinen
|