MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / createDirOrCheckWriteable

Method createDirOrCheckWriteable

settings/filemanager.cpp:155–168  ·  view source on GitHub ↗

/ Create a directory if it doesn't exist. */ /

Source from the content-addressed store, hash-verified

153/* Create a directory if it doesn't exist. */
154/*************************************************/
155void FileManager::createDirOrCheckWriteable(QDir dir) {
156
157 if (!dir.exists()) {
158 if (!dir.mkdir(dir.path())) {
159 QLOG_FATAL() << "Failed to create directory '" << dir.path() << "'. Aborting program.";
160 exit(16);
161 }
162 } else {
163 if (!dir.isReadable()) {
164 QLOG_FATAL() << "Directory '" + dir.path() + "' does not have read permission. Aborting program.";
165 exit(16);
166 }
167 }
168}
169
170
171/**************************************************/

Callers

nothing calls this directly

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected