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. Async operations utilize Unreal's built-in background thread pool (AnyBackgroundThreadNormalTask). Destructive actions validate empty paths, drive roots, Windows system folders, invalid names, and source or destination mistakes before the operation runs.

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.
FileInputFull path to the source file.
DestinationFolderInputTarget 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.
FileInputFull path to the source folder.
DestinationFolderInputTarget 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"

void AMyActor::ExampleUsage()
{
    
    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.
FileInputFull path to the source file.
DestinationFolderInputTarget 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"

void AMyActor::ExampleUsage()
{
    
    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.
FileInputFull path to the source folder.
DestinationFolderInputTarget 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"

void AMyActor::ExampleUsage()
{
    
    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.
FolderInputFull 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"

void AMyActor::ExampleUsage()
{
    
    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.
FolderInputFull 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"

void AMyActor::ExampleUsage()
{
    
    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"

void AMyActor::ExampleUsage()
{
    
    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"

void AMyActor::ExampleUsage()
{
    
    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"

void AMyActor::ExampleUsage()
{
    
    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"

void AMyActor::ExampleUsage()
{
    
    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.
C++ Example
#include "FileSystemLibrary.h"

void AMyActor::ExampleUsage()
{
    
      const FWNTFileInfo Info = UFileSystemLibrary::GetFileInfo(FilePath);
}

FWNTFileInfo Fields

FieldDescription
bExistsTrue if the file exists on the disk.
FileSizeSize of the file in bytes.
CreationTimeThe date and time the file was created.
LastAccessTimeThe date and time the file was last accessed.
LastWriteTimeThe date and time the file was last modified.
bIsReadOnlyTrue if the file has the read-only attribute set.
bIsHiddenTrue if the file is hidden by the OS.

Get Folder Info

Returns metadata for one folder path.

PinDirectionPurpose
FolderPathInputFolder path to inspect.
Return ValueOutputFWNTFolderInfo containing folder-specific metadata.
C++ Example
#include "FileSystemLibrary.h"

void AMyActor::ExampleUsage()
{
    
      const FWNTFolderInfo Info = UFileSystemLibrary::GetFolderInfo(FolderPath);
}

FWNTFolderInfo Fields

FieldDescription
bExistsTrue if the directory exists on the disk.
CreationTimeThe date and time the folder was created.
LastAccessTimeThe date and time the folder was last accessed.
LastWriteTimeThe date and time the folder was last modified.
bIsHiddenTrue if the directory is hidden by the OS.

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

Get Folder Size

Calculates folder size asynchronously. This node is highly optimized using FDirectoryStatVisitor for O(1) syscall performance on large directories.

Calculates folder size asynchronously. This node is highly optimized using FDirectoryStatVisitor for O(1) syscall performance on large directories.

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"

void AMyActor::ExampleUsage()
{
    
      UFileSystemLibrary::ShowFileInExplorer(FilePath);
}

Get Drives

Returns available Windows drives and basic capacity information.

PinDirectionPurpose
Return ValueOutputTArray<FPartitionInfo> with drive identity and capacity details.
C++ Example
#include "FileSystemLibrary.h"

void AMyActor::ExampleUsage()
{
    
      const TArray<FPartitionInfo> Drives = UFileSystemLibrary::GetAllAvailablePartitions();
}

FPartitionInfo Fields

FieldDescription
DriveLetterThe drive letter assigned to the partition (e.g., "C").
VolumeNameThe human-readable label of the volume.
FileSystemThe format of the file system (e.g., "NTFS", "FAT32").
TotalSpaceMBThe total storage capacity of the partition in Megabytes.
FreeSpaceMBThe available free storage on the partition in Megabytes.
DriveTypeThe type of drive (e.g., Fixed, Removable, Network).

Last updated on

On this page