Re: SAMP on Windows

From: Mark Taylor <m.b.taylor-at-bristol.ac.uk>
Date: Wed, 14 May 2008 09:48:41 +0100 (BST)


On Tue, 13 May 2008, Luigi Paioro wrote:

> No, it isn't. Usually the System Drive is C: but it could be different
> (although very rarely). Then, instead of using the Windows Registry, I would
> put the lock file in the Windows counterpart of UNIX $HOME, that is the
> %USERPROFILE% environment variable. %USERPROFILE% should be available since
> Windows NT4 and 2000 and points to
>
> {System Drive}:\windows\Profile under Windows NT4 and 2000
> {System Drive}\Documents and Settings\{username} under Window XP
> {System Drive}\Users\{username} under Windows Vista
>
> (I verified only Windows XP).
>
> So the developer has only to test the existence of the environment variable
> HOME and/or USERPROFILE, and then s/he can handle the lock file exactly in
> the same way, using the suitable path.

Luigi,

excellent - USERPROFILE sounds like exactly what we need then. It should be easy to implement like that, without requiring too much system-dependent code, in any sensible language. Unless anyone disagrees I will amend the text accordingly.

Mark

-- 
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor@bris.ac.uk +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/
Received on 2008-05-14Z10:48:48