Lines Matching refs:os
32 import os, os.path, shutil, signal, socket, sys
33 from os import environ as env
34 from os.path import join as joinpath, expanduser
41 for root, dirs, files in os.walk(dir, False):
43 os.remove(joinpath(root, name))
45 os.rmdir(joinpath(root, name))
73 return os.spawnvp(os.P_WAIT, args[0], args)
83 if os.path.exists(self.dir):
84 if not os.path.isdir(self.dir):
87 os.mkdir(self.dir)
90 return os.path.isdir(self.dir)
96 return os.path.isfile(self.file(filename))
110 if os.path.isfile(filename):
111 os.unlink(filename)
147 rootdir = env.setdefault('ROOTDIR', os.getcwd())
156 if os.path.isdir("/work"):
164 os.umask(0022)
175 if os.path.isdir(workdir):
178 os.mkdir(workdir)
180 if False and os.path.isdir('/z/dist'):
187 os.chdir(workdir)
191 os.symlink(jobdir.file('output'), 'status.out')
202 childpid = os.fork()
206 fd = os.open(jobdir.file("output"),
207 os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
208 os.dup2(fd, sys.stdout.fileno())
209 os.dup2(fd, sys.stderr.fileno())
210 os.execvp(args[0], args)
214 os.kill(childpid, signum)
227 thepid,ec = os.waitpid(childpid, 0)