mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-27 15:30:06 +00:00
Updated error handling
This commit is contained in:
parent
66c380bd97
commit
362a90f3dc
@ -59,6 +59,9 @@ bool RascsiImage::CreateImageFolder(int fd, const string& filename)
|
||||
if (filename_start != string::npos) {
|
||||
string folder = filename.substr(0, filename_start);
|
||||
|
||||
// Checking for existence first prevents an error if the top-level folder is a softlink
|
||||
struct stat st;
|
||||
if (stat(folder.c_str(), &st)) {
|
||||
std::error_code error;
|
||||
filesystem::create_directories(folder, error);
|
||||
if (error) {
|
||||
@ -66,6 +69,7 @@ bool RascsiImage::CreateImageFolder(int fd, const string& filename)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user