FPaths::CollapseRelativeDirectories

Takes a fully pathed string and eliminates relative pathing (eg: annihilates ".." with the adjacent directory).

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/Paths.h

Include

#include "Misc/Paths.h"

Source

/Engine/Source/Runtime/Core/Private/Misc/Paths.cpp

Syntax

static bool CollapseRelativeDirectories
(
    FString & InPath
)

Remarks

Takes a fully pathed string and eliminates relative pathing (eg: annihilates ".." with the adjacent directory). Assumes all slashes have been converted to TEXT('/'). For example, takes the string: BaseDirectory/SomeDirectory/../SomeOtherDirectory/Filename.ext and converts it to: BaseDirectory/SomeOtherDirectory/Filename.ext

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss