Skip to main content

UEFMFile

A BlueprintType UObject representing a file on disk. Provides methods for reading, writing, and manipulating file data without needing to specify the directory and name each time.

Properties

PropertyTypeAccessDescription
NameFStringReadOnlyThe file name
ExtensionFStringReadOnlyThe file extension
DirectoryFStringReadOnlyThe directory containing the file

Information Functions

GetFullPath

Pure Returns the full path (Directory + Name + Extension).

C++

FString GetFullPath()

Blueprint Node

ƒGet Full Path
Return Value

GetName

FString GetName()

GetExtension

FString GetExtension()

GetDirectory

FString GetDirectory()

GetSizeInBytes

Pure Returns file size in bytes.

C++

int64 GetSizeInBytes()

Blueprint Node

ƒGet Size In Bytes
Return Value

GetSizeInMegaBytes

Pure Returns file size in megabytes.

C++

double GetSizeInMegaBytes()

Blueprint Node

ƒGet Size In Mega Bytes
Return Value

GetHumanReadableSize

Pure Returns human-readable size string (e.g., "1.5 MB").

C++

FString GetHumanReadableSize()

Blueprint Node

ƒGet Human Readable Size
Return Value

GetCreationTime

Pure

C++

FDateTime GetCreationTime()

Blueprint Node

ƒGet Creation Time
Return Value

GetLastModifiedTime

Pure

C++

FDateTime GetLastModifiedTime()

Blueprint Node

ƒGet Last Modified Time
Return Value

GetLastAccessTime

Pure

C++

FDateTime GetLastAccessTime()

Blueprint Node

ƒGet Last Access Time
Return Value

GetMD5

Pure

C++

FString GetMD5()

Blueprint Node

ƒGet MD5
Return Value

GetSHA1

Pure

C++

FString GetSHA1()

Blueprint Node

ƒGet SHA1
Return Value

IsReadOnly

Pure

C++

bool IsReadOnly()

Blueprint Node

ƒIs Read Only
Return Value

SetReadOnly

Callable

C++

bool SetReadOnly(bool bReadOnly)

Blueprint Node

ƒSet Read Only
B Read Only
Return Value

Data Access - Strings

GetStrings

Pure Reads all lines into a string array.

C++

TArray<FString> GetStrings()

Blueprint Node

ƒGet Strings
Return Value

GetSingleString

Pure Reads entire file into one string.

C++

FString GetSingleString()

Blueprint Node

ƒGet Single String
Return Value

AppendString

Callable Appends a string to the file.

C++

void AppendString(FString StringToAppend)

Blueprint Node

ƒAppend String
String To Append

Data Access - Images

GetTexture

Pure Converts the file to a Texture2D.

C++

void GetTexture(EImageConversionResult& ConversionResult, UTexture2D*& Texture)

Blueprint Node

ƒGet Texture
Conversion Result
Texture
ParameterTypeDirectionDescription
ConversionResultEImageConversionResultOutResult of the conversion
TextureUTexture2D*OutThe converted texture

Data Access - Sound

GetSound

Pure Converts the file to a SoundWave.

C++

USoundWave* GetSound()

Blueprint Node

ƒGet Sound
Return Value

Data Access - Raw Bytes

GetBytes

Pure

C++

TArray<uint8> GetBytes()

Blueprint Node

ƒGet Bytes
Return Value

WriteBytes

Callable

C++

bool WriteBytes(TArray<uint8> ByteDataToWrite)

Blueprint Node

ƒWrite Bytes
Byte Data To Write
Return Value

Data Access - CSV

GetCsvDataAsString

Pure

C++

FString GetCsvDataAsString(FString Delimiter = TEXT(","))

Blueprint Node

ƒGet Csv Data As String
Delimiter
?
Return Value

Data Access - INI

GetIniDataAsString

Pure

C++

FString GetIniDataAsString()

Blueprint Node

ƒGet Ini Data As String
Return Value

Data Access - JSON

GetJsonData

Pure Reads JSON file into a TMap.

C++

TMap<FString, FString> GetJsonData()

Blueprint Node

ƒGet Json Data
Return Value

WriteJsonData

Callable Writes a TMap as JSON to the file.

C++

bool WriteJsonData(TMap<FString, FString> Data)

Blueprint Node

ƒWrite Json Data
Data
Return Value

Data Access - Encryption

Encrypt

Callable Encrypts the file with XOR.

C++

bool Encrypt(FString Key)

Blueprint Node

ƒEncrypt
Key
Return Value

Decrypt

Callable Decrypts the file with XOR.

C++

bool Decrypt(FString Key)

Blueprint Node

ƒDecrypt
Key
Return Value

Chunked Operations

ReadChunk

Callable Reads a chunk of bytes from the file.

C++

bool ReadChunk(int64 Offset, int32 Size, TArray<uint8>& OutData)

Blueprint Node

ƒRead Chunk
Offset
Size
Out Data
Return Value
ParameterTypeDirectionDescription
Offsetint64InByte offset to start reading from
Sizeint32InNumber of bytes to read
OutDataTArray<uint8>OutThe read bytes

WriteChunk

Callable Writes bytes at a specific offset.

C++

bool WriteChunk(int64 Offset, const TArray<uint8>& Data)

Blueprint Node

ƒWrite Chunk
Offset
Data
Return Value

AppendChunk

Callable Appends bytes to the end of the file.

C++

bool AppendChunk(const TArray<uint8>& Data)

Blueprint Node

ƒAppend Chunk
Data
Return Value

Usage Example

// Create a file
CreateFile(GetGameSavedDirectory(), "data.txt") -> bSuccess, MyFile

// Write to it
MyFile.AppendString("Line 1")
MyFile.AppendString("Line 2")

// Read it back
Lines = MyFile.GetStrings()
Size = MyFile.GetSizeInBytes()
ReadableSize = MyFile.GetHumanReadableSize() // e.g., "12 B"

// Get hash
Hash = MyFile.GetMD5()

// Check attributes
bReadOnly = MyFile.IsReadOnly()