Message from discussion
how to simulate tar filename substitution across piped subprocess.Popen() calls?
Received: by 10.224.189.16 with SMTP id dc16mr7985840qab.0.1352734618975;
Mon, 12 Nov 2012 07:36:58 -0800 (PST)
MIME-Version: 1.0
Received: by 10.52.34.205 with SMTP id b13mr3799235vdj.3.1352734618939; Mon,
12 Nov 2012 07:36:58 -0800 (PST)
Path: gf5ni18188417qab.0!nntp.google.com!c7no21334563qap.0!postnews.google.com!k21g2000vbj.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 12 Nov 2012 07:36:58 -0800 (PST)
Complaints-To: groups-abuse@google.com
Injection-Info: k21g2000vbj.googlegroups.com; posting-host=62.7.92.68; posting-account=xy4V0QkAAAAoGgkMsSsv6bfFPHkQXvOY
NNTP-Posting-Host: 62.7.92.68
References: <da975275-d4ce-4a01-892b-8a1e1274b611@b19g2000vbt.googlegroups.com>
<509c588a$0$6904$e4fe514c@news2.news.xs4all.nl> <5b39febc-fbb9-4d8e-b331-0401e78d2b7f@m13g2000vbd.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-Via: 1.1 INTERNETSERVER
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0,gzip(gfe)
Message-ID: <fdc89c1f-d0da-4fd3-8576-3cd7c94cba89@k21g2000vbj.googlegroups.com>
Subject: Re: how to simulate tar filename substitution across piped
subprocess.Popen() calls?
From: jkn <jkn...@nicorp.f9.co.uk>
Injection-Date: Mon, 12 Nov 2012 15:36:58 +0000
Content-Type: text/plain; charset=ISO-8859-1
slight followup ...
I have made some progress; for now I'm using subprocess.communicate to
read the output from the first subprocess, then writing it into the
secodn subprocess. This way I at least get to see what is
happening ...
The reason 'we' weren't seeing any output from the second call (the
'xargs') is that as mentioned I had simplified this. The actual shell
command was more like (in python-speak):
"xargs -I {} sh -c \"test -f %s/{} && md5sum %s/{}\"" % (mydir, mydir)
ie. I am running md5sum on each tar-file entry which passes the 'is
this a file' test.
My next problem; how to translate the command-string clause
"test -f %s/{} && md5sum %s/{}" # ...
into s parameter to subprocss.Popen(). I think it's the command
chaining '&&' which is tripping me up...
Cheers
J^n