regarding system function

Fredrik Lundh fredrik at pythonware.com
Fri Apr 22 03:46:07 EDT 2005


"praba kar" wrote:

> I agree above statement but When I delete a directory
> os.system('rm -rf test')
> 0
> if directory is not present then I again try to
> delete
> os.system('rm -rf test')
> now this time also It will print
> 0

so?  if you read the "rm" man page, you'll find this little paragraph:

       -f, --force
              ignore nonexistent files, never prompt

if you don't want "rm" to ignore nonexistent files, don't use -f.  and if you want
total control over the removal process, don't use an external process.

</F> 






More information about the Python-list mailing list