os.system function

Zabin zabin.farishta at gmail.com
Mon Jan 11 23:42:34 CET 2010


On Jan 12, 11:31 am, Jeremy Sanders <jeremy
+complangpyt... at jeremysanders.net> wrote:
> Zabin wrote:
> > Thanks for the pointers....i had a look around and found the site:
>
> http://www.microsoft.com/resources/documentation/windows/xp/all/prodd...
> us/xcopy.mspx?mfr=true
>
>
>
> > to disable the prompt- i needed to include /y as below:
> >  os.system ('xcopy /s %s %s /y ' % (dirExe, dirname_new))
>
> > and just wondering- whats the drawback of using os.system() command
>
> - It won't work across different platforms (unix, mac, windows)
> - Spaces or special characters in the filename will mess up the command line
> and can lead to huge security flaws in your program.
> - It's inefficient as you have to start a new program to do the work (slow
> on windows)
> - Error handling from the xcopy process will not be easy
>
> --
> Jeremy Sandershttp://www.jeremysanders.net/

wow- thanks heaps!



More information about the Python-list mailing list