# Creating a File Directory

**URL:** <https://forums.unrealengine.com/t/creating-a-file-directory/452605>\
**Category:** C++\
**Tags:** folder, unreal-engine, UE4, question, CPP\
**Created:** [July 21, 2019, 7:45pm UTC](https://forums.unrealengine.com/t/creating-a-file-directory/452605 "2019-07-21T19:45:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1168704f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1168704f](https://forums.unrealengine.com/u/anonymous_user_1168704f)\
**Post date:** [July 21, 2019, 7:45pm UTC](https://forums.unrealengine.com/t/creating-a-file-directory/452605/1 "2019-07-21T19:45:35Z")

</div>

Does UE4 has a built in function for creating a file directory inside the Project Content Directory?  
I’ve currently found this FPaths::ProjectContentDir(), but need to create a file directory inside it.

```
FString Path = FPaths::ProjectContentDir();

```

---

<div class="post-metadata">

**Author:** ![phil\_me\_up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil\_me\_up](https://forums.unrealengine.com/u/phil_me_up)\
**Post date:** [July 21, 2019, 8:07pm UTC](https://forums.unrealengine.com/t/creating-a-file-directory/452605/2 "2019-07-21T20:07:05Z")

</div>

Something like:

```
	IPlatformFile& platformFile = FPlatformFileManager::Get().GetPlatformFile();

	// Directory Exists?
	if (!platformFile.DirectoryExists(*_folder))
	{
		platformFile.CreateDirectory(*_folder);
	}

```

Where \_folder is an FString of your folder path

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1168704f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1168704f](https://forums.unrealengine.com/u/anonymous_user_1168704f)\
**Post date:** [July 21, 2019, 8:14pm UTC](https://forums.unrealengine.com/t/creating-a-file-directory/452605/3 "2019-07-21T20:14:02Z")

</div>

yep, that works if I specify the path like this “C:\User\MyProject\Content\NewFolder\”, but that way it won’t really work when a new project is created and the path is different.

---

<div class="post-metadata">

**Author:** ![JesseHumphry](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jessehumphry/32/1215657_2.png) [@JesseHumphry](https://forums.unrealengine.com/u/JesseHumphry)\
**Post date:** [April 21, 2021, 6:56pm UTC](https://forums.unrealengine.com/t/creating-a-file-directory/452605/4 "2021-04-21T18:56:11Z")

</div>

Append your directory to your FString Path rather than specifying it outright.
