🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #6772

Re: Creación ràpida i sencilla de logs( orientación e ideas)

#6772
From: Alberto Giménez
Date: Sat, 10 May 2003 18:16
39 lines
2581 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Sat, 10 May 2003 17:47:08 +0200, CountZero escribi�:
> procesos hijos (forks y tal) yo no uso (ni quiero crear) m�s de un proceso.
> 
No es necesario, para lo que lo quieres.

> A ver si lo he entendido bien. Supongamos que quiero que todo lo enviado
> al fd 2 (STDERR) vaya directo al archivo abierto para escritura indicado
> por el descriptor fd_archivo_log.
> 
> fd=dup2(2,fd_archivo_log);
> 
> Bien, ahora fd qu� �s ? Quiero decir: �s un nuevo fd, per� me sirve para
> algo ?, supongo que a�n podr� escrivir sobre fd 2 (STDERR) y
> fd_archivo_log.
> 

Lo que has hecho es DUPLICAR fd, o sea, que todo lo que vaya al
decriptor 2 y al fd se escribir� sobre el archivo. Por lo tanto, ya no
"tienes" stderr. Con fd puedes hacer lo que quieras, hasta cerrarlo :)
ya que no lo necesitas (escribes sobre el descriptor 2)
 
Saludos

- -- 
Alberto Gim�nez, SimManiac en el IRC
http://www.geocities.com/simmaniac_es
GNU/Linux Debian Woody 3.0 GnuPG ID: 0x3BAABDE1
Linux registered user #290801
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+vUIW0keCtzuqveERAvfVAJwORX9epZp9Gm5EAR6Hf4NZ9xExhACfcU/8
zrGAKxaDX/+g0igQKE4lOb4=
=B84g
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <mmfj9b.9u.ln@teleline.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!east.cox.net!cox.net!antonio.escomposlinux.org!teleline.es!nobody
References: <pan.2003.05.10.09.57.08.27496@l3jane.net> <jnoi9b.sb.ln@teleline.es> <3EBCE97F.41EF1E2D@terra.es> <pan.2003.05.10.15.47.07.970378@l3jane.net>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,7601551dd0bddf69
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-05-11 07:50:31 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!east.cox.net!cox.net!antonio.escomposlinux.org!teleline.es!nobody
From: Alberto Giménez <algibe@teleline.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Creación ràpida i sencilla de logs(
 orientación e ideas)
Date: Sat, 10 May 2003 20:16:54 +0200
Organization: Ecolnet
Lines: 39
Message-ID: <mmfj9b.9u.ln@teleline.es>
References: <pan.2003.05.10.09.57.08.27496@l3jane.net> <jnoi9b.sb.ln@teleline.es> <3EBCE97F.41EF1E2D@terra.es> <pan.2003.05.10.15.47.07.970378@l3jane.net>
Reply-To: algibe@teleline.es
NNTP-Posting-Host: 16-bar2-x34.libre.retevision.es
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: antonio.escomposlinux.org 1052664628 22168 62.82.128.16 (11 May 2003 14:50:28 GMT)
X-Complaints-To: antonio@escomposlinux.org
NNTP-Posting-Date: Sun, 11 May 2003 14:50:28 +0000 (UTC)
User-Agent: slrn/0.9.7.4 (Linux)