Profiles really only have a strong meaning under NT. There was a per-user
desktop on Windows 9x, but it was pretty weak.

For NT, to accurately get the profile for a user, you can use
GetUserProfileDirectory -- but you have to get the user's token first. Which
for all intents and purposes means you can only really do this for the
current user.

You can use GetProfilesDirectory (again, NT only) to get the default profile
directory, then append the user's name, and you'll have a good chance of
being right in most cases. But there's always the chance that the user has a
non-default profile directory (i.e. a roaming profile or other such
complication).

The current user's profile directory is put into the environment variable
USERPROFILE. This can be overridden, but that is rare (and if you override
it, you deserve what you get).

In any case, I'm not sure that I would actually want Vim to make any attempt
at processing the ~ character. It is not a particularly normal or expected
convention on Windows.

/*
That's not to say that I don't wish it were available, but it isn't
typically done for Windows (outside of Cygwin etc.). And it would sure be
nice to have the profiles directory consistently symlinked somewhere. But it
isn't, and somehow I've survived anyway :)
*/

>-----Original Message-----
>From: vim_dev@googlegroups.com [mailto:[EMAIL PROTECTED] On
>Behalf Of Tony Mechelynck
>Sent: Wednesday, September 26, 2007 1:25 AM
>To: vim_dev@googlegroups.com
>Subject: Re: Patch: problems with filename contains '~' in file-marks
>
>
>Ben Schmidt wrote:
>>> The only thing that requires a little care (IIUC) is to make sure
>that if the
>>> tilde is followed by a backslash, the latter is a "true" backslash
>and not an
>>> "escaper" backslash for something else than a backslash: in ~\foo, ~
>means
>>> $HOME while in ~\ foo it doesn't, and the filename is "~ foo". But
>maybe I'm
>>> overcomplexifying.
>>
>> Mmm. That seems true enough. But then who starts a filename with a
>tilde anyway?!
>
>Who knows? The point is that the tilde is a valid filename character on
>FAT
>filesystems, and is used extensively in 8.3 filenames, as in
>C:\PROGRA~1\MOZILL~2\ etc.
>
>>
>> But what I was actually referring to was the ability to expand other
>users' home
>> directories with ~user. That could be handy on Windows, too, but I
>don't know what
>> hoops you might need to go through to reliably find other users'
>directories!
>
>Neither do I, and AFAIK Vim never dit it -- yet. I guess it would be
>handy
>indeed, but I suppose this would rate as "improvement" rather than
>"normal" or
>"major" on a bug-severity scale. I think it would be possible, but not
>as easy
>as on Unix, since POSIX (or something) as a standard "/home/username/"
>(even
>for root where /home/root/ is a symlink to /root/) while IIRC the exact
>location of a user's home directory varies from one Windows version to
>the
>other. Or maybe there is some environment variable or some registry
>setting
>which could be brought to task, I don't know.
>
>>
>>> Vim-for-Cygwin is a Unix-like build, the shell handles the tilde.
>This thread
>>> is only busy with native-window at this point.
>>
>> O yes, of course. Easy.
>>
>> Ben.
>
>Best regards,
>Tony.
>--
>In 1750 Issac Newton became discouraged when he fell up a flight of
>stairs.
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui