[fpc-pascal] Get user ID for name on Linux

Tobias Giesen tobiasgiesen at gmail.com
Wed Jan 3 11:57:46 CET 2018


Many thanks! That's great. The completeness of FPC units and packages is really
astonishing.

Cheers,
Tobias

----

On Wed, 3 Jan 2018 06:36:32 +0000
Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:

> On 2018-01-03 00:12, Tobias Giesen wrote:
> > Unfortunately Libc and UnixUtils don't seem to be available in 64-bit, so I can't call the
> > functions getpwnam or GetUserId.
> 
> As Marco said, you can use the "users" unit. Here is an example of how I 
> use in in fpGUI, and it supports 32-bit and 64-bit systems.
> 
>  
> https://github.com/graemeg/fpGUI/blob/develop/src/corelib/x11/fpg_x11.pas#L4010-L4044
> 
> Note though that it only works for Linux. So other UNIX-type systems 
> like FreeBSD and Solaris are not supported.
> 
> 
> Regards,
>    Graeme
> 
> -- 
> fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
> http://fpgui.sourceforge.net/
> 
> My public PGP key:  http://tinyurl.com/graeme-pgp
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Buddenstr. 29-31
48143 Münster, Germany
www.superflexible.com
www.tgtools.com

-----------------------------------------------------------
Registered at register court Münster as HRA 9716
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Giesen




More information about the fpc-pascal mailing list