Lines Matching refs:_os
42 import os as _os namespace
52 _text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
53 if hasattr(_os, 'O_NOFOLLOW'):
54 _text_openflags |= _os.O_NOFOLLOW
57 if hasattr(_os, 'O_BINARY'):
58 _bin_openflags |= _os.O_BINARY
60 if hasattr(_os, 'TMP_MAX'):
61 TMP_MAX = _os.TMP_MAX
78 _os.lstat(fn)
115 prefix = _os.fsencode(template)
136 cur_pid = _os.getpid()
159 dirname = _os.getenv(envname)
163 if _os.name == 'nt':
164 dirlist.extend([ _os.path.expanduser(r'~\AppData\Local\Temp'),
165 _os.path.expandvars(r'%SYSTEMROOT%\Temp'),
172 dirlist.append(_os.getcwd())
174 dirlist.append(_os.curdir)
191 if dir != _os.curdir:
192 dir = _os.path.abspath(dir)
196 filename = _os.path.join(dir, name)
198 fd = _os.open(filename, _bin_openflags, 0o600)
204 _os.close(fd)
206 _os.unlink(filename)
213 if (_os.name == 'nt' and _os.path.isdir(dir) and
214 _os.access(dir, _os.W_OK)):
244 names = map(_os.fsencode, names)
248 file = _os.path.join(dir, pre + name + suf)
251 fd = _os.open(file, flags, 0o600)
257 if (_os.name == 'nt' and _os.path.isdir(dir) and
258 _os.access(dir, _os.W_OK)):
262 return (fd, _os.path.abspath(file))
276 return _os.fsencode(gettempprefix())
294 return _os.fsencode(gettempdir())
352 names = map(_os.fsencode, names)
356 file = _os.path.join(dir, prefix + name + suffix)
359 _os.mkdir(file, 0o700)
365 if (_os.name == 'nt' and _os.path.isdir(dir) and
366 _os.access(dir, _os.W_OK)):
399 file = _os.path.join(dir, prefix + name + suffix)
423 if _os.name != 'nt':
430 def close(self, unlink=_os.unlink):
538 if _os.name == 'nt' and delete:
539 flags |= _os.O_TEMPORARY
548 _os.unlink(name)
549 _os.close(fd)
552 if _os.name != 'posix' or _sys.platform == 'cygwin':
561 _O_TMPFILE_WORKS = hasattr(_os, 'O_TMPFILE')
586 flags2 = (flags | _os.O_TMPFILE) & ~_os.O_CREAT
587 fd = _os.open(dir, flags2, 0o600)
610 _os.close(fd)
616 _os.unlink(name)
620 _os.close(fd)
790 _os.chflags(path, 0)
793 _os.chmod(path, 0o700)
797 resetperms(_os.path.dirname(path))
801 _os.unlink(path)