On Fri, Aug 16, 2013, at 7:47, Roy Smith wrote: > There is no need to shell out to dd just to do this. All dd is doing > for you is seeking to the offset you specify and closing the file. You > can do that entirely in Python code. > > http://docs.python.org/2.7/library/stdtypes.html#file.seek
*ahem* http://docs.python.org/2.7/library/stdtypes.html#file.truncate The dd recipe was written some time over a decade ago as the easiest way to achieve this at a shell prompt (before the truncate tool was added to coreutils), and no-one's ever thought twice about it. -- http://mail.python.org/mailman/listinfo/python-list