> I like to write a configfile into the users-home directory,
> but therefore
> I need to know the current username. Does in Erlang something
> like "whoami" exists like in unix?
You can always use:
which will give you the home directory of the user who started the beam
process (barring no doubt some determined effort by the user to hide this..)
NOTICE AND DISCLAIMER:
This email (including attachments) is confidential. If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents. We cannot accept liability for any breaches of
confidence arising through use of email. Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions. We will not accept responsibility for any commitments
made by our employees outside the scope of our business. We do not warrant
the accuracy or completeness of such information.
> > Hi,
> > I like to write a configfile into the users-home directory,
> > but therefore
> > I need to know the current username. Does in Erlang something
> > like "whoami" exists like in unix?
> You can always use:
> or even:
> 2>os:cmd("echo $HOME").