Speed of shutil.copy vs os.system("copy src dest") in win32

Tim Roberts timr at probo.com
Thu Apr 27 03:17:53 EDT 2006


"Russell Warren" <russandheather at gmail.com> wrote:

>I just did a comparison of the copying speed of shutil.copy against the
>speed of a direct windows copy using os.system.  I copied a file that
>was 1083 KB.
>
>I'm very interested to see that the shutil.copy copyfileobj
>implementation of hacking through the file and writing a new one is
>significantly faster... any clue as to why this is?  I figure I'm
>missing something here.
>
>Does os.system launch a cmd shell every time?

Yes.  That's in the documentation.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list