if (pathname = copyString( resourceID(u))) {
if ((pathname = copyString( resourceID(u))) != NULL) {
pmGetSlotValue (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PRBool inversep,  PRBool tv){  if ((s == gCoreVocab->RDF_parent) && (type == RDF_RESOURCE_TYPE) && (pmUnitp(u)) && tv) {    if (inversep) {      char* filePathname =  resourceID(u);      size_t n = revCharSearch('/', filePathname);      char nname[512];      PRDir *d;      PRBool ans = 0;      memcpy((char*)nname, filePathname, n);      d = OpenMailDir(nname);      ans = (d != NULL);      PR_CloseDir(d);      if (ans) {	RDF_Resource r = RDF_GetResource(NULL, nname, 1);	setResourceType(r, PM_RT);	setContainerp(r, 1);	return r;      } else return NULL;    } else {      PRDir* d = OpenMailDir( resourceID(u));      PRDirEntry* de = PR_ReadDir(d, PR_SKIP_BOTH);      if (de != NULL) {	char nname[100];	sprintf(nname, "%s/%s",  resourceID(u), de->name);	PR_CloseDir(d);	return CreatePMUnit(nname, resourceType(u), false);      } else {	PR_CloseDir(d);	return NULL;      }    }  } else if ((s == gCoreVocab->RDF_name) && (type == RDF_STRING_TYPE) && (tv) && (pmUnitp(u))) {  	char *pathname, *name = NULL;  	int len,n;  	  	if (pathname = copyString( resourceID(u))) {  	  len = strlen(pathname);  	  if (pathname[len-1] == '/')  pathname[--len] = '\0';  	  if (endsWith(".sbd", pathname))	pathname[len-4] = '\0';  	  n = revCharSearch('/', pathname);  	  name = unescapeURL(&pathname[n+1]);  	  freeMem(pathname);  	}    return(name);  }  else if ((s == gWebData->RDF_URL) && (type == RDF_STRING_TYPE) && (tv) && (pmUnitp(u))) {	int		len;	char		*pos, *name;        if (resourceType(u) == PM_RT) return( copyString(resourceID(u)));	if (resourceType(u) == IM_RT)	{		len = strlen( resourceID(u));		if (resourceID(u)[len-1] == '/')	return(copyString(resourceID(u)));		if ((pos=strstr(resourceID(u),"IMAPMail/")) != NULL)		{			if ((name = PR_smprintf("imap://%s",pos+9)) != NULL)			{				/* IMAP RFC specifies INBOX (all uppercase) ??? */				if (endsWith ("/Inbox", name))				{					strcpy(&name[strlen(name)-5],"INBOX");				}			}			return(name);		}	}  }  return NULL;}