Exemple #1
0
def recursive_create_dir(dirname):
  with errors.raise_exception_on_not_ok_status() as status:
    dirs = dirname.split('/')
    for i in range(len(dirs)):
      partial_dir = '/'.join(dirs[0:i+1])
      if partial_dir and not file_exists(partial_dir):
        pywrap_tensorflow.CreateDir(compat.as_bytes(partial_dir), status)
Exemple #2
0
def create_dir_v2(path):
  """Creates a directory with the name given by 'path'.

  Args:
    path: string, name of the directory to be created
  Notes: The parent directories need to exist. Use recursive_create_dir instead
    if there is the possibility that the parent dirs don't exist.

  Raises:
    errors.OpError: If the operation fails.
  """
  pywrap_tensorflow.CreateDir(compat.as_bytes(path))
Exemple #3
0
def create_dir(dirname):
    """Creates a directory with the name 'dirname'.

  Args:
    dirname: string, name of the directory to be created

  Notes:
    The parent directories need to exist. Use recursive_create_dir instead if
    there is the possibility that the parent dirs don't exist.

  Raises:
    errors.OpError: If the operation fails.
  """
    with errors.raise_exception_on_not_ok_status() as status:
        pywrap_tensorflow.CreateDir(compat.as_bytes(dirname), status)
Exemple #4
0
def recursive_create_dir(dirname):
    """Create a directory and all parent/intermediate directories.

  Args:
    dirname: string, name of the directory to be created

  Raises:
    errors.OpError: If the operation fails.
  """
    with errors.raise_exception_on_not_ok_status() as status:
        dirs = dirname.split('/')
        for i in range(len(dirs)):
            partial_dir = '/'.join(dirs[0:i + 1])
            if partial_dir and not file_exists(partial_dir):
                pywrap_tensorflow.CreateDir(compat.as_bytes(partial_dir),
                                            status)
Exemple #5
0
def create_dir(dirname):
  with errors.raise_exception_on_not_ok_status() as status:
    pywrap_tensorflow.CreateDir(compat.as_bytes(dirname), status)