/* If return is EFI_SUCCESS, the Filehandle is the opened directory's handle; otherwise, the Filehandle is NULL. If the directory already existed, this function opens the existing directory. */
EFI_STATUS EFIAPI ShellCreateDirectory(IN CONST CHAR16 *DirectoryName, OUT SHELL_FILE_HANDLE *FileHandle)
/* If return is EFI_SUCCESS, the Filehandle is the opened directory's handle; otherwise, the Filehandle is NULL. If the directory already existed, this function opens the existing directory. */
EFI_STATUS EFIAPI ShellCreateDirectory(IN CONST CHAR16 *DirectoryName, OUT SHELL_FILE_HANDLE *FileHandle)
{
  if (gEfiShellProtocol != NULL) {
    return (gEfiShellProtocol->CreateFile (
                                 DirectoryName,
                                 EFI_FILE_DIRECTORY,
                                 FileHandle
                                 ));
  } else {
    return (ShellOpenFileByName (
              DirectoryName,
              FileHandle,
              EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
              EFI_FILE_DIRECTORY
              ));
  }
}