os.execl()

eli eli at udel.edu
Mon Aug 27 09:57:05 EDT 2001


Hello,

	I have a question about the ececl function from the os module. I was
trying to write a script to untar a bunch of tarballs in a directory. The
script looked like this

#!/usr/bin/env python

import os

os.system("ls *.gz > data_file")

tar_file = open("data_file"), "r")

tar_array = tar_file.readlines()

for tarball in tar_array:
	os.execl("tar", "xzvf", tarball)

os.system("rm data_file")




I was getting errors from the xzvf argument of tar during the first
evecution of the loop. I'm pretty new to python so I don't knwo where to
go from here. I would appreciate any help that you could give me. 

																	Thanks,
																			eli



More information about the Python-list mailing list