On 07/04/2008, David Pratt <[EMAIL PROTECTED]> wrote: > Hi. I am trying to replace a system call with a subprocess call. I have > tried subprocess.Popen and subprocess.call with but have not been > successful. The command line would be: > > svnadmin dump /my/repository > svndump.db > > This is what I am using currently: > > os.system('svnadmin dump %s > %s' % (svn_dir, > os.path.join(backup_dir, 'svndump.db'))) > > Many thanks. > > -- > http://mail.python.org/mailman/listinfo/python-list >
Hey David, Your probably want something like the following (code untested and off the cuff ;-) ) Cheers Dave --- import subprocess p = subprocess.Popen( [ "svnadmin", "dump" ], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True ) (child_stdout, child_stdin) = (p.stdout, p.stdin) f = open('svndump.db') f.write(child_stdout.read()) f.close() -- http://mail.python.org/mailman/listinfo/python-list