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)
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))
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)
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)
def create_dir(dirname): with errors.raise_exception_on_not_ok_status() as status: pywrap_tensorflow.CreateDir(compat.as_bytes(dirname), status)