New issue
Advanced search Search tips

Issue 786374 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

base::File problem with illegal file paths

Project Member Reported by eladalon@chromium.org, Nov 17 2017

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.
 
Labels: -Pri-3 Pri-2

Sign in to add a comment