[racket] Username

From: David Mitchell (djm at kluged.net)
Date: Wed Dec 7 08:43:58 EST 2011

José Lopes <jose.lopes at ...> writes:

> 
> Hello everyone,
> 
> How do I get the username of the person who is logged in the system?
> 
> At the moment I am doing this, but it looks terrible...
> 
> (define (current-user)
>    (path->string (file-name-from-path (find-system-path 'home-dir))))
> 
> Regards,
> José
> 


If you want to username of the user running racket you can just use (genenv
"USER") assuming the variable is defined in the environment.

regards, david mitchell



Posted on the users mailing list.