def generate_big_random_bin_file()

in fsxlcw/utils/diskfill.py [0:0]


def generate_big_random_bin_file(directory, file_name, size):
    """
    generate big binary file with the specified size in bytes
    :param directory: the parnt directory where the files will be created
    :param file_name: the file name
    :param size: the size in bytes
    :return:void
    """

    # create the folder that will contain the files
    if not os.path.isdir(directory):
        raise SystemExit(f"OBS! The directory {directory} doesn't exist")

    directory = directory.rstrip("/")
    with open( f"{directory}/RANDOM_{file_name}", 'wb' ) as fout:
        fout.write(os.urandom(size))
        print( f"created file: {directory}/RANDOM_{file_name}" )

    pass