return NS_NewNativeLocalFile(nsDependentCString(fullPath), PR_TRUE, aResult); #elif defined(XP_OS2) char fullPath[MAXPATHLEN];  if (!realpath(aPath, fullPath)) return NS_ERROR_FAILURE;   for (char* ptr = strchr(fullPath, '/'); ptr; ptr = strchr(ptr, '/')) *ptr = '\\';
XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult){#if defined(XP_MACOSX)    PRInt32 pathLen = strlen(aPath);    if (pathLen > MAXPATHLEN)        return NS_ERROR_INVALID_ARG;    CFURLRef fullPath =        CFURLCreateFromFileSystemRepresentation(NULL, aPath, pathLen, true);    if (!fullPath)        return NS_ERROR_FAILURE;    nsCOMPtr<nsILocalFile> lf;    nsresult rv = NS_NewNativeLocalFile(EmptyCString(), PR_TRUE,                                        getter_AddRefs(lf));    if (NS_SUCCEEDED(rv)) {        nsCOMPtr<nsILocalFileMac> lfMac = do_QueryInterface(lf, &rv);        if (NS_SUCCEEDED(rv)) {            rv = lfMac->InitWithCFURL(fullPath);            if (NS_SUCCEEDED(rv))                NS_ADDREF(*aResult = lf);        }    }    CFRelease(fullPath);    return rv;#elif defined(XP_UNIX) || defined(XP_OS2)    char fullPath[MAXPATHLEN];    if (!realpath(aPath, fullPath))        return NS_ERROR_FAILURE;    return NS_NewNativeLocalFile(nsDependentCString(fullPath), PR_TRUE,                                 aResult);#elif defined(XP_WIN)    char fullPath[MAXPATHLEN];    if (!_fullpath(fullPath, aPath, MAXPATHLEN))        return NS_ERROR_FAILURE;    return NS_NewNativeLocalFile(nsDependentCString(fullPath), PR_TRUE,                                 aResult);#elif defined(XP_BEOS)    BPath fullPath;    if (fullPath.SetTo(aPath, NULL, true))        return NS_ERROR_FAILURE;    return NS_NewNativeLocalFile(nsDependentCString(fullPath.Leaf()), PR_TRUE,                                 aResult);#else#error Platform-specific logic needed here.#endif}