base::File problem with illegal file paths |
|
Issue description
":" should be an illegal file path on macOS. However, observe the following code:
auto file_path = base::FilePath(FILE_PATH_LITERAL(":"));
constexpr int file_flags = base::File::FLAG_CREATE | base::File::FLAG_WRITE |
base::File::FLAG_EXCLUSIVE_WRITE;
base::File file(file_path, file_flags);
if (!file.IsValid() || !file.created()) {
// Expected
} else {
// Unexpected
}
Unexpectedly, the else-statement is entered.
|
|
►
Sign in to add a comment |
|
Comment 1 by eladalon@chromium.org
, Nov 17 2017