If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

nsLocalFile::Remove returns different values on OS X and Windows when directory does not exist

NEW
Unassigned

Status

()

Core
XPCOM
--
minor
2 years ago
2 years ago

People

(Reporter: haik, Unassigned)

Tracking

48 Branch
Points:
---

Firefox Tracking Flags

(firefox48 affected)

Details

(Reporter)

Description

2 years ago
nsLocalFile::Remove returns different values on OS X and Windows when the directory being deleted does not exist.

On OS X, attempting to delete a non-existent directory using nsLocalFile::Remove() returns NS_ERROR_FILE_TARGET_DOES_NOT_EXIST because OS X rmdir(2) sets errno=ENOENT. ENOENT is converted to NS_ERROR_FILE_TARGET_DOES_NOT_EXIST in nsresultForErrno() from xpcom/io/nsLocalFile.h.

On Windows, attempting to delete a non-existent directory using nsLocalFile::Remove() returns NS_ERROR_FILE_NOT_FOUND.

It would simplify error handling if they returned the same thing regardless of platform.
(Reporter)

Updated

2 years ago
See Also: → bug 1261751
You need to log in before you can comment on or make changes to this bug.