# How create folder when my game is running

**URL:** <https://forums.unrealengine.com/t/how-create-folder-when-my-game-is-running/372378>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 3, 2016, 10:51pm UTC](https://forums.unrealengine.com/t/how-create-folder-when-my-game-is-running/372378 "2016-10-03T22:51:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarlMckayre](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CarlMckayre](https://forums.unrealengine.com/u/CarlMckayre)\
**Post date:** [October 3, 2016, 10:51pm UTC](https://forums.unrealengine.com/t/how-create-folder-when-my-game-is-running/372378/1 "2016-10-03T22:51:47Z")

</div>

Hello, I want create a folder when my game is running. I’ve tried to use the c++ function [mkdir], but it doesn’t work.  
So, how I can do that.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_aa2a7fa1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_aa2a7fa1](https://forums.unrealengine.com/u/anonymous_user_aa2a7fa1)\
**Post date:** [October 4, 2016, 5:20am UTC](https://forums.unrealengine.com/t/how-create-folder-when-my-game-is-running/372378/2 "2016-10-04T05:20:08Z")

</div>

Found this with a quick google search: [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/File_Management,_Create_Folders,_Delete_Files,_and_More)

Specifically:

```
Verify or Create Directory
//If this function cannot find or create the directory, returns false.
static FORCEINLINE bool VerifyOrCreateDirectory(const FString& TestDir) const
{
	// Every function call, unless the function is inline, adds a small
	// overhead which we can avoid by creating a local variable like so.
	// But beware of making every function inline!
	IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
 
	// Directory Exists?
	if (!PlatformFile.DirectoryExists(*TestDir)) 
	{
		PlatformFile.CreateDirectory(*TestDir);
 
		if (!PlatformFile.DirectoryExists(*TestDir)) 
		{
			return false;
			// ~~~~~~~~~~~~~~
		}
	}
	return true;
}

```
