Skip to content

Commit 3b0d628

Browse files
committed
Create temp directory if it does not exist
1 parent 3ddd65b commit 3b0d628

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/add_install_dlg_derived.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ void AddNewInstallDlg::InstallSelected(wxCommandEvent&){
177177
throw runtime_error("Unable to download installer");
178178
}
179179
else{
180+
// create the temp location if it does not exist
181+
#if defined __APPLE__ || defined __linux__
182+
int status = mkdir(cachedir.string().c_str(),S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
183+
#elif defined _WIN32
184+
int status = mkdir(cachedir.string().c_str());
185+
#endif
186+
180187
// write the file to temp location
181188
auto outpath = fmt::format("{}{}{}.{}", cachedir.string(), "UnityDownloadAssistant", data.hashcode, installerExt);
182189
ofstream outfile(outpath, std::ios::binary);

0 commit comments

Comments
 (0)