/* Function to determine if a given filename represents a file. */
EFI_STATUS EFIAPI ShellIsFile(IN CONST CHAR16 *Name)
/* Function to determine if a given filename represents a file. */
EFI_STATUS EFIAPI ShellIsFile(IN CONST CHAR16 *Name)
{
  EFI_STATUS         Status;
  SHELL_FILE_HANDLE  Handle;
  ASSERT (Name != NULL);
  Handle = NULL;
  Status = ShellOpenFileByName (Name, &Handle, EFI_FILE_MODE_READ, 0);
  if (EFI_ERROR (Status)) {
    return (Status);
  }
  if (FileHandleIsDirectory (Handle) != EFI_SUCCESS) {
    ShellCloseFile (&Handle);
    return (EFI_SUCCESS);
  }
  ShellCloseFile (&Handle);
  return (EFI_NOT_FOUND);
}