Beispiel #1
0
def create_file_if_not_exists(file_path: Text, file_contents: Text):
    """
    Creates directory if it does not exist.

    Args:
        file_path (str): Local path in filesystem.
        file_contents (str): Contents of file.
    """
    if not file_io.file_exists_v2(file_path):
        file_io.write_string_to_file(file_path, file_contents)
Beispiel #2
0
def write_file_contents(file_path: Text, content: Text):
    """
    Writes contents of file.

    Args:
        file_path (str): Path to file.
        content (str): Contents of file.
    """
    return file_io.write_string_to_file(file_path, content)