All Samples(6609) | Call(6580) | Derive(0) | Import(29)
close(fd) Close a file descriptor (for low level IO).
src/e/v/evserver-HEAD/evserver/examples/comet.py evserver(Download)
yield t.write('padding5')
except GeneratorExit:
pass
os.close(fd)
return iterator()
class comet_longpoll:
yield environ['x-wsgiorg.fdevent.readable'](fd)
except GeneratorExit:
pass
os.close(fd)
return iterator()
web.header('Content-Type', 'text/plain; charset=utf-8')
fd = os.open(path, os.O_WRONLY | os.O_NONBLOCK)
os.write(fd, web.data() )
os.close(fd)
return 'ok'
fd = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)
os.read(fd, 4096)
yield environ['x-wsgiorg.fdevent.readable'](fd, 1.0)
os.close(fd)
yield t.write(uid)
while True:
fd = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)
os.read(fd, 4096)
yield environ['x-wsgiorg.fdevent.readable'](fd)
yield t.write(os.read(fd, 4096))
os.close(fd)
fd = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)
yield environ['x-wsgiorg.fdevent.readable'](fd)
yield t.write(os.read(fd, 4096))
os.close(fd)
except GeneratorExit:
pass
os.unlink(fname)
src/d/u/dutils-0.0.10/dutils/sample/path.py dutils(Download)
def touch(self):
""" Set the access/modified times of this file to the current time.
Create the file if it does not exist.
"""
fd = os.open(self, os.O_WRONLY | os.O_CREAT, 0666)
os.close(fd)
os.utime(self, None)
src/f/u/fuse-python-0.2/example/xmp.py fuse-python(Download)
def flush(self):
self._fflush()
# cf. xmp_flush() in fusexmp_fh.c
os.close(os.dup(self.fd))
def fgetattr(self):
return os.fstat(self.fd)
src/v/a/vapp-HEAD/trunk/samples/sample-ivrd.py vapp(Download)
os.dup2(fd, sys.__stdin__.fileno())
os.dup2(fd, sys.__stdout__.fileno())
os.dup2(fd, sys.__stderr__.fileno())
os.close(fd)
signal.signal(signal.SIGHUP, old_sighup)
if __name__ == '__main__':
src/v/a/vapp-HEAD/samples/sample-ivrd.py vapp(Download)
os.dup2(fd, sys.__stdin__.fileno())
os.dup2(fd, sys.__stdout__.fileno())
os.dup2(fd, sys.__stderr__.fileno())
os.close(fd)
signal.signal(signal.SIGHUP, old_sighup)
if __name__ == '__main__':
src/p/y/python-cookbook-HEAD/cb2_examples/cb2_10_6_sol_1.py python-cookbook(Download)
def edited_text(starting_text=''):
temp_fd, temp_filename = tempfile.mkstemp(text=True)
os.write(temp_fd, starting_text)
os.close(temp_fd)
editor = what_editor()
x = os.spawnlp(os.P_WAIT, editor, editor, temp_filename)
if x:
src/p/k/pksampler-HEAD/pk/stereo/CDLow.py pksampler(Download)
def cd_close(): if cd.cd < 1: cd.open = 0 return 0 os.close(cd.cd) cd.cd = 0 cd.open = 0
src/s/i/simupop-HEAD/doc/runSampleCode.py simupop(Download)
else:
skip = False
tmp, tmpSrcName = tempfile.mkstemp()
os.close(tmp)
tmpSrc = open(tmpSrcName, 'w')
count += 1
if skip:
tmpSrc.close()
tmpSrc = None
tmp, tmpLogName = tempfile.mkstemp()
os.close(tmp)
os.system('%s %s %s' % (sys.argv[0], tmpSrcName, tmpLogName))
#
writeFile(open(tmpSrcName).readlines(), filename)
src/v/i/vizstack-HEAD/trunk/share/samples/xconfig_generation/2gpu.py vizstack(Download)
# Populate XML into a temporary file (fd, tempFile) = tempfile.mkstemp() os.write(fd, configXML) os.close(fd) # Invoke configuration file generator with this input # This will print out the X configuration file
src/v/i/vizstack-HEAD/trunk/share/samples/xconfig_generation/1gpu-1output.py vizstack(Download)
# Populate XML into a temporary file (fd, tempFile) = tempfile.mkstemp() os.write(fd, configXML) os.close(fd) # Invoke configuration file generator with this input # This will print out the X configuration file
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next