From ripley at stats.ox.ac.uk  Fri Aug 13 09:02:07 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri Aug 13 09:02:09 2004
Subject: [Rd] (PR#7163) Install packages does not work on Win2003 serv er
In-Reply-To: <3699CDBC4ED5D511BE6400306E1C0D81074CBBFD@hermes.demogr.mpg.de>
Message-ID: <Pine.LNX.4.44.0408130743370.18608-100000@gannet.stats>

On Fri, 13 Aug 2004, Walke, Rainer wrote:

> 	Do you know which part of the R code creates this temporary file*
> directories in the library subdirectory?

Why don't *you* know?  It is install.packages, surprisingly enough, in its
internal function unpackPkg, and running that under debug would show you
what is going on.  Once again, remember only you can do this as we cannot 
reproduce your claims.

Do remember you have already been told that you are using an unsupported 
OS, and quite possible a file system that has never been tested and is not 
supported by the compilers we use to build R.

One possible issue is that code uses

                file.rename(file.path(tmpDir, curPkg), instPath)

Internally that boils down to

int Rwin_rename(char *from, char *to)
{
    int res = 0;
    OSVERSIONINFO verinfo;

    verinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    GetVersionEx(&verinfo);
    switch(verinfo.dwPlatformId) {
    case VER_PLATFORM_WIN32_NT:
	res = (MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING) == 0);
	break;
    default:
	if (!DeleteFile(to) && GetLastError() != ERROR_FILE_NOT_FOUND)
	    return 1;
	res = (MoveFile(from, to) == 0);
    }
    return res;
}

Now, what your unsupported OS reports for dwPlatformId is undocumented in 
the MinGW header files (and in the VC6 docs), and your OS did not exist 
when that was written.  Given the choices

#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2

it is the third according the Microsoft's current Platform SDK, but is 
that correct (it seems to predate the release of your OS)?  Please check 
it for us.

BDR

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] (PR#7163) Install packages does not work on Win2003 serv er
Prof Brian Ripley