Skip to content

Commit 68becb4

Browse files
committed
extra check added MacOS is strange
1 parent b070ae3 commit 68becb4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/FileUtils.cxx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,19 @@ namespace TiCC {
136136

137137
void erase( const string& name ){
138138
/// remove a file
139-
try {
139+
if ( isFile( name ) ){
140140
filesystem::path p(name);
141-
filesystem::remove( p );
141+
try {
142+
filesystem::remove( p );
143+
}
144+
catch ( const exception& e ){
145+
// error OR file doesn't exist
146+
throw runtime_error( "could not erase file/path '" + name + "': "
147+
+ e.what() );
148+
}
142149
}
143-
catch ( const exception& e ){
144-
// error OR file doesn't exist
145-
throw runtime_error( "could not erase file/path '" + name + "': "
146-
+ e.what() );
150+
else {
151+
throw runtime_error( "could not erase file/path '" + name + "'" );
147152
}
148153
}
149154

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