Article View: es.comp.os.linux.programacion
Article #11564Re: Necesito una llamada al sistema q me devuelva el path del directorio HOME
From: MANUEL HERMAN CAPITAN
Date: Tue, 06 Nov 2001 10:37
Date: Tue, 06 Nov 2001 10:37
43 lines
2192 bytes
2192 bytes
Kanijo: Asi a bote pronto se me ocurren 2 opciones. Bien coger la variable HOME del entorno, o bien usar tu linea del fichero /etc/passwd donde uno de los campos es tu directorio de inicio. Para coger la variable de entorno usa getenv(), y para tu linea en el fichero /etc/passwd getpwent(). Mira en el manual el uso de estas funciones, no son dificiles de usar. Espero haber ayudado.Suerte Y ese que tanto habla está totalmente hueco. Ya sabeis que el cántaro vacío es el que más suena... On Tue, 6 Nov 2001, Ana wrote: > Hola: > > Necesito una llamada al sistema (estoy programando en C,bajo Linux), > q me devuelva el path del directorio home. > > Es decir, necesito hacer un llamada, que es similar a > > $ cd > ---- Ahora me devolveria el directorio por defecto en el > q siempre trabajo (el home) > > > gracias. > > Ana. > > > > > >
Technical Details
Message-ID:
<Pine.GSO.4.10.10111061135170.24051-100000@lucano>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!news.comunitel.net!news.rediris.es!News.cica.es!""!lucano!i82hecamReferences:
<9s8acr$nh9$1@news.wanadoo.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,afa94ed0d84b0f8e X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-11-06 03:01:06 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!news.comunitel.net!news.rediris.es!News.cica.es!""!lucano!i82hecam From: MANUEL HERMAN CAPITAN <i82hecam@uco.es> Newsgroups: es.comp.os.linux.programacion Subject: Re: Necesito una llamada al sistema q me devuelva el path del directorio HOME Date: Tue, 6 Nov 2001 11:37:46 +0100 Organization: C.I.C.A. Lines: 44 Message-ID: <Pine.GSO.4.10.10111061135170.24051-100000@lucano> References: <9s8acr$nh9$1@news.wanadoo.es> NNTP-Posting-Host: lucano.uco.es Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: mercurio.cica.es 1005042878 2463 150.214.110.200 (6 Nov 2001 10:34:38 GMT) X-Complaints-To: news@cica.es NNTP-Posting-Date: 6 Nov 2001 10:34:38 GMT X-Sender: i82hecam@lucano In-Reply-To: <9s8acr$nh9$1@news.wanadoo.es>