"Copy File" node does not copy despite error checks

This setup should copy the file from one folder to another, but it does not work for me
Im checking if the Source File is exist which it does, and checked the Target Directory also exist
Testing in editor in UE5.5
I imagine that my input strings might be incorrect?
If that is the case, how should I modify then, how would it be correct?

I would really appreciate if someone could point me in the right direction, what am I missing :slight_smile:

You need Get Project Saved Directory

The copy file node only works with revision control. If you don’t have a project setup then it will fail.
image

I would just make a blueprint function library in c++ to copy the file.

(post deleted by author)

Thank you for the quick answer!

So, if I understand this correctly, the Copy File node will NOT work in a Shipped build?

I highly doubt it. You will need to access the pure file related functions in c++

.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "FileLibrary.generated.h"

/**
 * 
 */
UCLASS()
class COPYSAVE_API UFileLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable, Category="File Operations")
	static bool CopyFile(FString SourceFile, FString TargetFile);

};


.cpp

// Fill out your copyright notice in the Description page of Project Settings.


#include "FileLibrary.h"

bool UFileLibrary::CopyFile(FString SourceFile, FString TargetFile)
{
	IPlatformFile& platformFile = FPlatformFileManager::Get().GetPlatformFile();	
	if (FPaths::FileExists(SourceFile))
	{		
		UE_LOG(LogTemp, Error, TEXT("Source file %s does not exist"), *SourceFile);
		return platformFile.CopyFile(*TargetFile, *SourceFile);
	}
	else return false;
}

outcome

Lol ok I made it a plugin and then only realized that unreal already has a file operation blueprint library that covers file operations :person_shrugging:

Go into plugins and enable Blueprint file utilities

The copy file will do the same as my code :stuck_out_tongue:

I can confirm that it works in the packed version of the game!

That is the one, thank you so much! :slight_smile: