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
SWIFT
SWIFTsim
Commits
4d61cf9d
Commit
4d61cf9d
authored
Jul 14, 2017
by
Peter W. Draper
Browse files
We also require that directories can be searched, so make that explicit
This is a requirement of fopen()
parent
f0639090
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
4d61cf9d
...
...
@@ -387,11 +387,12 @@ int main(int argc, char *argv[]) {
#endif
/* Check that we can write the snapshots by testing if the output
* directory exists and is writable. */
* directory exists and is
searchable and
writable. */
char
basename
[
PARSER_MAX_LINE_SIZE
];
parser_get_param_string
(
params
,
"Snapshots:basename"
,
basename
);
const
char
*
dirp
=
dirname
(
basename
);
if
(
access
(
dirp
,
W_OK
)
!=
0
)
{
message
(
"dirp = %s"
,
dirp
);
if
(
access
(
dirp
,
W_OK
|
X_OK
)
!=
0
)
{
error
(
"Cannot write snapshots in directory %s (%s)"
,
dirp
,
strerror
(
errno
));
}
...
...
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