File System Library
File, folder, drive, and async file-operation nodes for Windows Native Toolkit.
Use this library for safe Windows file-system operations. Destructive actions validate empty paths, drive roots, Windows system folders, invalid names, and source or destination mistakes before the operation runs.
Python examples use Unreal's reflected API names through the unreal module. Async file-operation nodes stay C++-only here because their delegate-driven execution model is not practical to run from Unreal Python.
Async File Operations
Move File To Path, Move Folder To Path, Copy File To Path, Copy Folder To Path, Delete File, Delete Folder, Recycle File, Recycle Folder, Rename File, and Rename Folder are async action nodes. In Blueprint they give an immediate Then continuation pin plus direct On Success and On Fail exec pins.
Failure Reporting
Public error-message pins were removed. When a node fails, it uses the On Fail pin for Blueprint flow and writes the detailed reason with UE_LOG(Error, ...).
Move File To Path
Moves one file into a destination folder on a background thread.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Context used to register the async action with the game instance. |
Source | Input | Full path to the source file. |
Destination | Input | Target folder path. |
bOverwrite | Input | Allows the destination file to be replaced when it already exists. |
Then | Output | Continues immediately after the async action is created. |
On Success | Output | Fires when the move completes successfully. |
On Fail | Output | Fires when validation or the move operation fails. |
#include "FileSystemLibrary.h"
UFUNCTION()
void HandleFileOperationSuccess();
UFUNCTION()
void HandleFileOperationFail();
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::MoveFileToFolder(this, SourcePath, DestinationFolder, true);
Operation->OnSuccess.AddDynamic(this, &UMyObject::HandleFileOperationSuccess);
Operation->OnFail.AddDynamic(this, &UMyObject::HandleFileOperationFail);Move Folder To Path
Moves one folder into another folder on a background thread.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
Source | Input | Full path to the source folder. |
Destination | Input | Target parent folder path. |
bOverwrite | Input | Allows overwriting an existing target folder. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the move succeeds. |
On Fail | Output | Fires when validation or the move fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::MoveFolderToFolder(this, SourceFolder, DestinationFolder, false);Copy File To Path
Copies one file into a destination folder on a background thread.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
Source | Input | Full path to the source file. |
Destination | Input | Target folder path. |
bOverwrite | Input | Allows replacing an existing destination file. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the copy succeeds. |
On Fail | Output | Fires when validation or the copy fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::CopyFileToFolder(this, SourcePath, DestinationFolder, true);Copy Folder To Path
Copies one folder tree into a destination folder on a background thread.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
Source | Input | Full path to the source folder. |
Destination | Input | Target parent folder path. |
bOverwrite | Input | Allows replacing an existing destination folder. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the copy succeeds. |
On Fail | Output | Fires when validation or the copy fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::CopyFolderToFolder(this, SourceFolder, DestinationFolder, true);Delete File
Permanently deletes one file on a background thread after path safety checks.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
Path | Input | Full path to the file to delete. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the file is deleted. |
On Fail | Output | Fires when validation or deletion fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::DeleteFileW(this, FilePath);Delete Folder
Permanently deletes one folder tree on a background thread after path safety checks.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
Path | Input | Full path to the folder to delete. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the folder is deleted. |
On Fail | Output | Fires when validation or deletion fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::DeleteFolder(this, FolderPath);Recycle File
Moves one file to the Windows Recycle Bin instead of deleting it permanently.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
FilePath | Input | Full path to the file to recycle. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when Windows accepts the recycle request. |
On Fail | Output | Fires when validation or the recycle request fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::RecycleFile(this, FilePath);Recycle Folder
Moves one folder to the Windows Recycle Bin instead of deleting it permanently.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
FolderPath | Input | Full path to the folder to recycle. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when Windows accepts the recycle request. |
On Fail | Output | Fires when validation or the recycle request fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::RecycleFolder(this, FolderPath);Rename File
Renames a file in place on a background thread.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
FilePath | Input | Full path to the existing file. |
NewFileName | Input | New file name. Include the extension when the file should keep one. |
bOverwrite | Input | Allows replacing an existing file with the same target name. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the rename succeeds. |
On Fail | Output | Fires when validation or the rename fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::RenameFile(this, FilePath, TEXT("Renamed.txt"), true);Rename Folder
Renames a folder in place on a background thread.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
FolderPath | Input | Full path to the existing folder. |
NewFolderName | Input | New folder name only, not a full path. |
bOverwrite | Input | Allows replacing an existing folder with the same target name. |
Then | Output | Continues immediately after the node starts. |
On Success | Output | Fires when the rename succeeds. |
On Fail | Output | Fires when validation or the rename fails. |
#include "FileSystemLibrary.h"
UAsyncFileSystemOperation* Operation =
UAsyncFileSystemOperation::RenameFolder(this, FolderPath, TEXT("RenamedFolder"), true);Get File Info
Returns metadata for one file path.
| Pin | Direction | Purpose |
|---|---|---|
FilePath | Input | File path to inspect. |
Return Value | Output | FWNTFileInfo containing file-specific metadata. |
FWNTFileInfo fields:
bExistsAbsolutePathFileNameExtensionbIsReadOnlyFileSizeBytesCreationTimeAccessTimeModificationTime
#include "FileSystemLibrary.h"
const FWNTFileInfo Info = UFileSystemLibrary::GetFileInfo(FilePath);import unreal
info = unreal.FileSystemLibrary.get_file_info(file_path)Get Folder Info
Returns metadata for one folder path.
| Pin | Direction | Purpose |
|---|---|---|
FolderPath | Input | Folder path to inspect. |
Return Value | Output | FWNTFolderInfo containing folder-specific metadata. |
FWNTFolderInfo fields:
bExistsAbsolutePathFolderNameParentPathbIsReadOnlyCreationTimeAccessTimeModificationTime
The folder struct intentionally does not include size. Use Get Folder Size for size queries.
#include "FileSystemLibrary.h"
const FWNTFolderInfo Info = UFileSystemLibrary::GetFolderInfo(FolderPath);import unreal
info = unreal.FileSystemLibrary.get_folder_info(folder_path)Get Folder Size
Calculates folder size asynchronously and can report progress while the scan runs.
| Pin | Direction | Purpose |
|---|---|---|
WorldContextObject | Input | Async action registration context. |
FolderPath | Input | Folder path to scan recursively. |
Then | Output | Continues immediately after the node starts. |
On Progress | Output | Reports the current accumulated size in bytes while scanning. |
On Success | Output | Reports the final folder size in bytes. |
On Fail | Output | Fires when validation fails, the scan fails, or the scan is canceled. |
#include "FileSystemLibrary.h"
UFUNCTION()
void HandleFolderSizeProgress(int64 FolderSizeBytes);
UFUNCTION()
void HandleFolderSizeSuccess(int64 FolderSizeBytes);
UFUNCTION()
void HandleFolderSizeFail(int64 FolderSizeBytes);
UAsyncGetFolderSize* Operation = UAsyncGetFolderSize::GetFolderSize(this, FolderPath);
Operation->OnProgress.AddDynamic(this, &UMyObject::HandleFolderSizeProgress);
Operation->OnSuccess.AddDynamic(this, &UMyObject::HandleFolderSizeSuccess);
Operation->OnFail.AddDynamic(this, &UMyObject::HandleFolderSizeFail);Show File In Explorer
Opens Windows Explorer and selects the specified file or folder.
| Pin | Direction | Purpose |
|---|---|---|
FilePath | Input | File or folder path to reveal in Explorer. |
#include "FileSystemLibrary.h"
UFileSystemLibrary::ShowFileInExplorer(FilePath);import unreal
unreal.FileSystemLibrary.show_file_in_explorer(file_path)Get Drives
Returns available Windows drives and basic capacity information.
| Pin | Direction | Purpose |
|---|---|---|
Return Value | Output | TArray<FPartitionInfo> with drive identity and capacity details. |
FPartitionInfo fields:
DriveLetterVolumeLabelFileSystemDriveTypebIsSystemPartitionTotalSizeBytesFreeSizeBytesUsedSizeBytes
#include "FileSystemLibrary.h"
const TArray<FPartitionInfo> Drives = UFileSystemLibrary::GetAllAvailablePartitions();import unreal
drives = unreal.FileSystemLibrary.get_all_available_partitions()Last updated on