For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > May 2004 > How to get home directory of specified user?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to get home directory of specified user?
Stone

2004-05-18, 1:31 am

Hi,

I need get full path name for a specified user's directory.
For example, I need get the full path name "/home/John/temp" for "~John/temp".

Is there any function for that?

Thanks
Paul J

2004-05-18, 1:31 am

Stone wrote:

> Hi,
>
> I need get full path name for a specified user's directory.
> For example, I need get the full path name "/home/John/temp" for
> "~John/temp".
>
> Is there any function for that?
>
> Thanks


You could just type:
ls -d ~username

Paul J
Barry Margolin

2004-05-18, 2:31 am

In article <d3a92589.0405172008.791bd0ab@posting.google.com>,
diaolsbit@sohu.com (Stone) wrote:

> Hi,
>
> I need get full path name for a specified user's directory.
> For example, I need get the full path name "/home/John/temp" for "~John/temp".
>
> Is there any function for that?
>
> Thanks


getpwnam()

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com