2009/1/14 Reenen Laurie :
>
> {$ifdef windows}
> username := GetEnvironmentVariable('USERNAME');
> {$endif}
Nope, change that to something like:
var
userNameBuffer: array[0..255] of char;
sizeBuffer: DWord;
begin
SizeBuffer := 256;
getUserName(userNameBuffer, sizeBuffer);
result := st
On Wed, 14 Jan 2009, Reenen Laurie wrote:
> Ok, so if I want code in which I want to get the username, which is
> crossplatform... how should it look?
>
> {$ifdef windows}
> username := GetEnvironmentVariable('USERNAME');
> {$endif}
I'm not sure if this is correct; There is a windows call to
Ok, so if I want code in which I want to get the username, which is
crossplatform... how should it look?
{$ifdef windows}
username := GetEnvironmentVariable('USERNAME');
{$endif}
{$ifdef linux}
GetUserData(FpGetuid, Data);
username := Data.pw_uid;
{$endif}
How about MacOS?
Also, as a matte
On Wed, 14 Jan 2009, Reenen Laurie wrote:
> Sorry for digging up an old thread...
>
> I just want to know... Is this code crossplatfrom?
>
> GetUserData(FpGetuid, Data);
> > Result.Name:= Data.pw_name;
> > Result.Real_name:= Data.pw_gecos;
> > Result.User_id:= Data.pw_uid;
> > Result.Group_id:
Sorry for digging up an old thread...
I just want to know... Is this code crossplatfrom?
GetUserData(FpGetuid, Data);
> Result.Name:= Data.pw_name;
> Result.Real_name:= Data.pw_gecos;
> Result.User_id:= Data.pw_uid;
> Result.Group_id:= Data.pw_gid;
> Result.home_dir:= Data.pw_dir;
> Result.shell:
Marco van de Voort ha scritto:
> In our previous episode, Andrea Mauri said:
>
>> I solved using GetUserData procedure from users unit.
>>
>> GetUserData(FpGetuid, Data);
>> Result.Name:= Data.pw_name;
>> Result.Real_name:= Data.pw_gecos;
>> Result.User_id:= Data.pw_uid;
>> Result.Grou
In our previous episode, Andrea Mauri said:
> I solved using GetUserData procedure from users unit.
>
> GetUserData(FpGetuid, Data);
> Result.Name:= Data.pw_name;
> Result.Real_name:= Data.pw_gecos;
> Result.User_id:= Data.pw_uid;
> Result.Group_id:= Data.pw_gid;
> Result.home_dir:= Da
Thanks Marco.
I solved using GetUserData procedure from users unit.
GetUserData(FpGetuid, Data);
Result.Name:= Data.pw_name;
Result.Real_name:= Data.pw_gecos;
Result.User_id:= Data.pw_uid;
Result.Group_id:= Data.pw_gid;
Result.home_dir:= Data.pw_dir;
Result.shell:= Data.pw_shell;
On Tue, Dec 02, 2008 at 10:02:57PM +0100, Andrea Mauri wrote:
> there is a way in order to get the real name of a linux/windows user?
> In order to get the login name (linux) I used:
> Result.Name:= GetEnvironmentVariable('USERNAME');
> if Result.Name = '' then
> Result.Name:= GetEnvironmen
On Tue, Dec 2, 2008 at 11:02 PM, Andrea Mauri <[EMAIL PROTECTED]> wrote:
>
> there is a way in order to get the real name of a linux/windows user?
> In order to get the login name (linux) I used:
> Result.Name:= GetEnvironmentVariable('USERNAME');
> if Result.Name = '' then
>Result.Name:= Get
Hi,
there is a way in order to get the real name of a linux/windows user?
In order to get the login name (linux) I used:
Result.Name:= GetEnvironmentVariable('USERNAME');
if Result.Name = '' then
Result.Name:= GetEnvironmentVariable('USER');
I know that in linux I can use libc (getpwuid(fp
11 matches
Mail list logo