On 2013-04-11, Rob Schneider <rmsc...@gmail.com> wrote: > Using Python 2.7.2 on OSX, I have created a file in temp space, > then use the function "shutil.copyfile(fn,loc+fname)" from "fn" > to "loc+fname". > > At the destination location, the file is truncated. About 10% > of the file is lost. Original file is unchanged. > > I added calls to "statinfo" immediately after the copy, and all > looks ok (correct file size). > > filecmp.cmp(fn,loc+fname) > print "Statinfo :"+fn+":\n", os.stat(fn) > print "Statinfo :"+loc+fname+":\n", os.stat(loc+fname) > > But when I look at the file in Finder, destination is smaller > and even looking at the file (with text editor) file is > truncated. > > What could be causing this?
Could fn be getting some changes written after the copy is made? Is the file flushed/closed before you copy it? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list