unreal.BlueprintFileUtilsBPLibrary

class unreal.BlueprintFileUtilsBPLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

Blueprint File Utils BPLibrary

C++ Source:

  • Plugin: BlueprintFileUtils

  • Module: BlueprintFileUtils

  • File: BlueprintFileUtilsBPLibrary.h

classmethod copy_file(dest_filename, src_filename, replace=True, even_if_read_only=False) bool

Copies a file.

Parameters
  • dest_filename (str) –

  • src_filename (str) –

  • replace (bool) –

  • even_if_read_only (bool) –

Return type

bool

classmethod delete_directory(directory, must_exist=False, delete_recursively=False) bool

Deletes a directory and all the files in it and optionally all sub-directories and files within it

Parameters
  • directory (str) – The Directory to delete

  • must_exist (bool) – If true, the directory must exist or the return value will be false

  • delete_recursively (bool) – If true, all sub-directories will be deleted as well. If false and there are contents in the directory, the delete operation will fail.

Returns

true if the directory was succesfully deleted, false otherwise

Return type

bool

classmethod delete_file(filename, must_exist=False, even_if_read_only=False) bool

Deletes a file.

Parameters
  • filename (str) –

  • must_exist (bool) –

  • even_if_read_only (bool) –

Return type

bool

classmethod directory_exists(directory) bool

Checks if a directory exists

Parameters

directory (str) – The directory path to check

Returns

true if Directory exists, false otherwise

Return type

bool

classmethod file_exists(filename) bool

Checks if a file exists

Parameters

filename (str) – The filename to check

Returns

true if Filename exists, false otherwise

Return type

bool

classmethod find_files(directory, file_extension='') Array(str) or None

Finds all the files within the given directory, with optional file extension filter.

Parameters
  • directory (str) – The absolute path to the directory to search. Ex: “C:UnrealEditorPictures”

  • file_extension (str) – If FileExtension is empty string “” then all files are found. Otherwise FileExtension can be of the form .EXT or just EXT and only files with that extension will be returned.

Returns

true if anything was found, false otherwise

found_files (Array(str)): All the files found that matched the optional FileExtension filter, or all files if none was specified.

Return type

Array(str) or None

classmethod find_recursive(start_directory, wildcard='', find_files=True, find_directories=False) Array(str) or None

Finds all the files and/or directories within the given directory and any sub-directories. Files can be found with anoptional file extension filter.

Parameters
  • start_directory (str) – The absolute path to the directory to start the search. Ex: “C:UnrealEditorPictures”

  • wildcard (str) – Wildcard that can be used to find files or directories with specific text in their name. E.g .png to find all files ending with the png extension, *images to find anything with the word “images” in it Otherwise FileExtension can be of the form .EXT or just EXT and only files with that extension will be returned. Does not apply to directories

  • find_files (bool) – Whether or not to find files

  • find_directories (bool) – Whether or not to find directories

Returns

true if anything was found, false otherwise

found_paths (Array(str)): All the paths (directories and/or files) found

Return type

Array(str) or None

classmethod get_user_directory() str

Get the users directory. Platform specific (usually something like MyDocuments or the users home directory

Return type

str

classmethod make_directory(path, create_tree=False) bool

Makes a new directory, and optionally sub-directories

Parameters
  • path (str) – The directory path to make

  • create_tree (bool) – If true, the entire directory tree will be created if it doesnt exist. Otherwise only the leaft most directory will be created if possible

Returns

true if the directory was created, false otherwise

Return type

bool

classmethod move_file(dest_filename, src_filename, replace=True, even_if_read_only=False) bool

Move File

Parameters
  • dest_filename (str) –

  • src_filename (str) –

  • replace (bool) –

  • even_if_read_only (bool) –

Return type

bool