def open_path_helper(path, os_flags, append): # XXX for now always return DiskFile fd = rposix.open(path, os_flags, 0666) if append: try: os.lseek(fd, 0, 2) except OSError: # XXX does this pass make sense? pass return DiskFile(fd)
def f(): try: fd = rposix.open(self.path, os.O_RDONLY, 0777) try: text = os.read(fd, 50) return text finally: os.close(fd) except OSError: return ''
def entry_point(argv): fd = rposix.open("/tmp/foobar", os.O_RDONLY, 0777) assert fd == 77 fd2 = rposix.dup(fd) assert fd2 == 78 return 0