grr/core/grr_response_core/lib/util/temp.py
def TempFilePath(suffix = "", prefix = "tmp",
                 dir = None):  # pylint: disable=redefined-builtin
  """Creates a temporary file based on the environment configuration.

  If no directory is specified the file will be placed in folder as specified by
  the `TEST_TMPDIR` environment variable if available or fallback to
  `Test.tmpdir` of the current configuration if not.

  If directory is specified it must be part of the default test temporary
  directory.

  Args:
    suffix: A suffix to end the file name with.
    prefix: A prefix to begin the file name with.
    dir: A directory to place the file in.

  Returns:
    An absolute path to the created file.

  Raises:
    ValueError: If the specified directory is not part of the default test
        temporary directory.
  """
  precondition.AssertType(suffix, Text)
  precondition.AssertType(prefix, Text)
  precondition.AssertOptionalType(dir, Text)

  root = _TempRootPath()
  if not dir:
    dir = root
  elif root and not os.path.commonprefix([dir, root]):
    raise ValueError("path '%s' must start with '%s'" % (dir, root))

  _, path = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir)
  return path
Creates a temporary file based on the environment configuration.

  If no directory is specified the file will be placed in folder as specified by
  the `TEST_TMPDIR` environment variable if available or fallback to
  `Test.tmpdir` of the current configuration if not.

  If directory is specified it must be part of the default test temporary
  directory.

  Args:
    suffix: A suffix to end the file name with.
    prefix: A prefix to begin the file name with.
    dir: A directory to place the file in.

  Returns:
    An absolute path to the created file.

  Raises:
    ValueError: If the specified directory is not part of the default test
        temporary directory.
  
Creates a temporary file based on the environment configuration.
If no directory is specified the file will be placed in folder as specified by
the `TEST_TMPDIR` environment variable if available or fallback to
`Test.tmpdir` of the current configuration if not.

If directory is specified it must be part of the default test temporary
directory.
Creates a temporary file based on the environment configuration . If no directory is specified the file will be placed in folder as specified by the ` TEST_TMPDIR ` environment variable if available or fallback to ` Test . tmpdir ` of the current configuration if not . If directory is specified it must be part of the default test temporary directory .
def TempFilePath(suffix = "", prefix = "tmp",
                 dir = None):  
  precondition.AssertType(suffix, Text)
  precondition.AssertType(prefix, Text)
  precondition.AssertOptionalType(dir, Text)
  root = _TempRootPath()
  if not dir:
    dir = root
  elif root and not os.path.commonprefix([dir, root]):
    raise ValueError("path '%s' must start with '%s'" % (dir, root))
  _, path = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir)
  return path
def TempFilePath ( suffix = "" , prefix = "tmp" , dir = None ) : precondition . AssertType ( suffix , Text ) precondition . AssertType ( prefix , Text ) precondition . AssertOptionalType ( dir , Text ) root = _TempRootPath ( ) if not dir : dir = root elif root and not os . path . commonprefix ( [ dir , root ] ) : raise ValueError ( "path '%s' must start with '%s'" % ( dir , root ) ) _ , path = tempfile . mkstemp ( suffix = suffix , prefix = prefix , dir = dir ) return path
Creates a temporary file based on the environment configuration.
Creates a temporary file based on the environment configuration .
# pylint: disable=redefined-builtin """Creates a temporary file based on the environment configuration.

  If no directory is specified the file will be placed in folder as specified by
  the `TEST_TMPDIR` environment variable if available or fallback to
  `Test.tmpdir` of the current configuration if not.

  If directory is specified it must be part of the default test temporary
  directory.

  Args:
    suffix: A suffix to end the file name with.
    prefix: A prefix to begin the file name with.
    dir: A directory to place the file in.

  Returns:
    An absolute path to the created file.

  Raises:
    ValueError: If the specified directory is not part of the default test
        temporary directory.
  """
An absolute path to the created file.
An absolute path to the created file .
If the specified directory is not part of the default test
temporary directory.
If the specified directory is not part of the default test temporary directory .
ValueError
suffix
A suffix to end the file name with.
A suffix to end the file name with .
prefix
A prefix to begin the file name with.
A prefix to begin the file name with .
dir
A directory to place the file in.
A directory to place the file in .