Skip to content

Commit 8530df1

Browse files
committed
Call the error handler also when a file to be removed does not exist.
1 parent 7ebbfad commit 8530df1

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2025-04-17 Wolfgang Lux <wolfgang.lux@gmail.com>
2+
3+
* Source/NSFileManager.m (removeFileAtPath:handler:):
4+
Call the error handler also when a file to be removed does not
5+
exist.
6+
17
2025-04-16 Richard Frith-Macdonald <rfm@gnu.org>
28

39
* Source/NSPropertyList.m: When parsing OpenStep style property list,

Source/NSFileManager.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,11 @@ - (BOOL) removeFileAtPath: (NSString*)path
17481748

17491749
if (res == WIN32ERR)
17501750
{
1751-
return NO;
1751+
NSString *message = [[NSError _last] localizedDescription];
1752+
1753+
return [self _proceedAccordingToHandler: handler
1754+
forError: message
1755+
inPath: path];
17521756
}
17531757
if (res & FILE_ATTRIBUTE_DIRECTORY)
17541758
{
@@ -1763,7 +1767,11 @@ - (BOOL) removeFileAtPath: (NSString*)path
17631767

17641768
if (lstat(lpath, &statbuf) != 0)
17651769
{
1766-
return NO;
1770+
NSString *message = [[NSError _last] localizedDescription];
1771+
1772+
return [self _proceedAccordingToHandler: handler
1773+
forError: message
1774+
inPath: path];
17671775
}
17681776
is_dir = ((statbuf.st_mode & S_IFMT) == S_IFDIR);
17691777
#endif /* _WIN32 */

0 commit comments

Comments
 (0)