Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jens Krüger
Lima
Commits
1287f61b
Commit
1287f61b
authored
Oct 05, 2012
by
Sebastien Petitdemange
Committed by
Sebastien Petitdemange
Oct 05, 2012
Browse files
Create last saving directory if not exist
parent
052373f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
control/src/CtSaving.cpp
View file @
1287f61b
...
...
@@ -28,6 +28,8 @@
#ifdef __linux__
#include
<dirent.h>
#include
<sys/statvfs.h>
#else
#include
<direct.h>
#endif
#include
"CtSaving.h"
...
...
@@ -1615,7 +1617,11 @@ void CtSaving::SaveContainer::close()
/** @brief check if all file can be written
*/
#ifdef WIN32
#define CTSAVING_MKDIR(a,b) _mkdir(a)
#else
#define CTSAVING_MKDIR(a,b) mkdir(a,b)
#endif
void
CtSaving
::
Stream
::
checkWriteAccess
()
{
DEB_MEMBER_FUNCT
();
...
...
@@ -1646,11 +1652,13 @@ void CtSaving::Stream::checkWriteAccess()
THROW_CTL_ERROR
(
Error
)
<<
output
;
}
}
else
else
if
(
CTSAVING_MKDIR
(
m_pars
.
directory
.
c_str
(),
0777
))
{
output
=
"Directory : "
+
m_pars
.
directory
+
"
doesn't exist
"
;
output
=
"Directory : "
+
m_pars
.
directory
+
"
can't be created
"
;
THROW_CTL_ERROR
(
Error
)
<<
output
;
}
else
// Creation was successful don't need to test other thing
return
;
// test all file is mode == Abort
if
(
m_pars
.
overwritePolicy
==
Abort
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment