SAMP on Windows

Luigi Paioro luigi at lambrate.inaf.it
Tue May 13 08:49:58 PDT 2008


> I don't think we should assume Cygwin, but I like the idea of using C:\.
> Probably this should be qualified by a user name so that hubs of multiple
> users do not interfere with each other (or is multiple simultaneous
> users on the same machine effectively impossible on Windows?).
> Can any Windows experts comment on whether this might be problematic,
> e.g. is C:\ always present and writable?


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.

This is just another possibility.


Cheers,

   Luigi



More information about the apps-samp mailing list