Skip to content

Commit 9f9653c

Browse files
committed
fixed error handling in create_dir()
1 parent 8315259 commit 9f9653c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/FileUtils.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ namespace TiCC {
7777
It will recursively create all intermediate directories when needed
7878
*/
7979
error_code ec;
80-
filesystem::create_directory( p, ec );
81-
return ec.value() == 0;
80+
filesystem::create_directories( p, ec );
81+
if ( ec.value() != EEXIST
82+
&& ec.value() != 0 ){
83+
throw runtime_error( "create_dir(" + string(p) + ") failed: "
84+
+ ec.message() + " (" + std::to_string( ec.value())
85+
+ ")" );
86+
}
87+
return true;
8288
}
8389

8490
bool createPath( const string& name ){

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy