Windows Native Toolkit

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.

PinDirectionPurpose
WorldContextObjectInputContext used to register the async action with the game instance.
SourceInputFull path to the source file.
DestinationInputTarget folder path.
bOverwriteInputAllows the destination file to be replaced when it already exists.
ThenOutputContinues immediately after the async action is created.
On SuccessOutputFires when the move completes successfully.
On FailOutputFires when validation or the move operation fails.
C++ Example
#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.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
SourceInputFull path to the source folder.
DestinationInputTarget parent folder path.
bOverwriteInputAllows overwriting an existing target folder.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the move succeeds.
On FailOutputFires when validation or the move fails.
C++ Example
#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.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
SourceInputFull path to the source file.
DestinationInputTarget folder path.
bOverwriteInputAllows replacing an existing destination file.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the copy succeeds.
On FailOutputFires when validation or the copy fails.
C++ Example
#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.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
SourceInputFull path to the source folder.
DestinationInputTarget parent folder path.
bOverwriteInputAllows replacing an existing destination folder.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the copy succeeds.
On FailOutputFires when validation or the copy fails.
C++ Example
#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.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
PathInputFull path to the file to delete.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the file is deleted.
On FailOutputFires when validation or deletion fails.
C++ Example
#include "FileSystemLibrary.h"

UAsyncFileSystemOperation* Operation =
    UAsyncFileSystemOperation::DeleteFileW(this, FilePath);

Delete Folder

Permanently deletes one folder tree on a background thread after path safety checks.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
PathInputFull path to the folder to delete.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the folder is deleted.
On FailOutputFires when validation or deletion fails.
C++ Example
#include "FileSystemLibrary.h"

UAsyncFileSystemOperation* Operation =
    UAsyncFileSystemOperation::DeleteFolder(this, FolderPath);

Recycle File

Moves one file to the Windows Recycle Bin instead of deleting it permanently.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
FilePathInputFull path to the file to recycle.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when Windows accepts the recycle request.
On FailOutputFires when validation or the recycle request fails.
C++ Example
#include "FileSystemLibrary.h"

UAsyncFileSystemOperation* Operation =
    UAsyncFileSystemOperation::RecycleFile(this, FilePath);

Recycle Folder

Moves one folder to the Windows Recycle Bin instead of deleting it permanently.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
FolderPathInputFull path to the folder to recycle.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when Windows accepts the recycle request.
On FailOutputFires when validation or the recycle request fails.
C++ Example
#include "FileSystemLibrary.h"

UAsyncFileSystemOperation* Operation =
    UAsyncFileSystemOperation::RecycleFolder(this, FolderPath);

Rename File

Renames a file in place on a background thread.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
FilePathInputFull path to the existing file.
NewFileNameInputNew file name. Include the extension when the file should keep one.
bOverwriteInputAllows replacing an existing file with the same target name.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the rename succeeds.
On FailOutputFires when validation or the rename fails.
C++ Example
#include "FileSystemLibrary.h"

UAsyncFileSystemOperation* Operation =
    UAsyncFileSystemOperation::RenameFile(this, FilePath, TEXT("Renamed.txt"), true);

Rename Folder

Renames a folder in place on a background thread.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
FolderPathInputFull path to the existing folder.
NewFolderNameInputNew folder name only, not a full path.
bOverwriteInputAllows replacing an existing folder with the same target name.
ThenOutputContinues immediately after the node starts.
On SuccessOutputFires when the rename succeeds.
On FailOutputFires when validation or the rename fails.
C++ Example
#include "FileSystemLibrary.h"

UAsyncFileSystemOperation* Operation =
    UAsyncFileSystemOperation::RenameFolder(this, FolderPath, TEXT("RenamedFolder"), true);

Get File Info

Returns metadata for one file path.

PinDirectionPurpose
FilePathInputFile path to inspect.
Return ValueOutputFWNTFileInfo containing file-specific metadata.

FWNTFileInfo fields:

  • bExists
  • AbsolutePath
  • FileName
  • Extension
  • bIsReadOnly
  • FileSizeBytes
  • CreationTime
  • AccessTime
  • ModificationTime
C++ Example
#include "FileSystemLibrary.h"

const FWNTFileInfo Info = UFileSystemLibrary::GetFileInfo(FilePath);
Python Example
import unreal

info = unreal.FileSystemLibrary.get_file_info(file_path)

Get Folder Info

Returns metadata for one folder path.

PinDirectionPurpose
FolderPathInputFolder path to inspect.
Return ValueOutputFWNTFolderInfo containing folder-specific metadata.

FWNTFolderInfo fields:

  • bExists
  • AbsolutePath
  • FolderName
  • ParentPath
  • bIsReadOnly
  • CreationTime
  • AccessTime
  • ModificationTime

The folder struct intentionally does not include size. Use Get Folder Size for size queries.

C++ Example
#include "FileSystemLibrary.h"

const FWNTFolderInfo Info = UFileSystemLibrary::GetFolderInfo(FolderPath);
Python Example
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.

PinDirectionPurpose
WorldContextObjectInputAsync action registration context.
FolderPathInputFolder path to scan recursively.
ThenOutputContinues immediately after the node starts.
On ProgressOutputReports the current accumulated size in bytes while scanning.
On SuccessOutputReports the final folder size in bytes.
On FailOutputFires when validation fails, the scan fails, or the scan is canceled.
C++ Example
#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.

PinDirectionPurpose
FilePathInputFile or folder path to reveal in Explorer.
C++ Example
#include "FileSystemLibrary.h"

UFileSystemLibrary::ShowFileInExplorer(FilePath);
Python Example
import unreal

unreal.FileSystemLibrary.show_file_in_explorer(file_path)

Get Drives

Returns available Windows drives and basic capacity information.

PinDirectionPurpose
Return ValueOutputTArray<FPartitionInfo> with drive identity and capacity details.

FPartitionInfo fields:

  • DriveLetter
  • VolumeLabel
  • FileSystem
  • DriveType
  • bIsSystemPartition
  • TotalSizeBytes
  • FreeSizeBytes
  • UsedSizeBytes
C++ Example
#include "FileSystemLibrary.h"

const TArray<FPartitionInfo> Drives = UFileSystemLibrary::GetAllAvailablePartitions();
Python Example
import unreal

drives = unreal.FileSystemLibrary.get_all_available_partitions()

Last updated on

On this page