mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
fix #163; save file dir parent dir created
Previously when not using NSM, and the project dir ~/luppp/ did not exist, Luppp would fail to save the session as it did not attempt to create the directory. This patch adds the creating of the directory if it does not already exist.
This commit is contained in:
parent
394ced7f33
commit
e8b15b394c
1 changed files with 11 additions and 0 deletions
|
@ -95,6 +95,17 @@ void DiskWriter::initialize(std::string path, std::string name )
|
|||
sessionName = name;
|
||||
sessionPath = path;
|
||||
|
||||
/* If project dir doesn't exist yet, create it */
|
||||
int projectDir = mkdir( path.c_str(),
|
||||
S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
|
||||
if ( errno == EEXIST ) {
|
||||
//LUPPP_NOTE("project dir %s exists, this is good", path.c_str());
|
||||
} else if ( projectDir ) {
|
||||
LUPPP_WARN("Error creating projectDir: %s", strerror(errno));
|
||||
} else {
|
||||
LUPPP_NOTE("Creating %s directory", path.c_str());
|
||||
}
|
||||
|
||||
// write session.luppp JSON node to <path>/<sessionName>.luppp
|
||||
stringstream sessionDirStream;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue