[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] preview-latex, dvipng, and LyX
From: |
Enrico Forestieri |
Subject: |
Re: [AUCTeX-devel] preview-latex, dvipng, and LyX |
Date: |
Tue, 10 Jan 2006 01:34:28 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Jan-Åke Larsson <address@hidden> writes:
> Anyhow, the font-generating call is internal to kpathsea, it is not as
> if I get to choose where to send output. With glibc redirection should
> be easy, but without glibc I think I'll need to fork for every call to
> kpse_find_pk, and redirect or gobble output and _then_ call kpse_find_pk
> _again_ in the parent. Hmmmmmmmmm. Some overhead, but possible.
>
> Opinions?
> /JÅ
Hi Jan-Åke.
What about freopen? I tested the code below under solaris, linux and
windows with both mingw (gcc -mno-cygwin, really) and the
free MSVC compiler. All tests succeeded!
--
Enrico
$ cat rd.kirby.c
/*
* Sample code posted by Lawrence Kirby
* Date: Mon, 02 Mar 98 01:51:38 GMT
* Subject: temporarily reassigning stdout/stderr
* Message-ID: <address@hidden>
*
* (Nonportable: uses dup() and dup2() system calls for
* duplicating underlying file descriptors, which are
* present in Unix but not necessarily anywhere else.)
*/
#include <stdio.h>
main()
{
int fd;
fpos_t pos;
printf("stdout, ");
fflush(stdout);
fgetpos(stdout, &pos);
fd = dup(fileno(stdout));
freopen("stdout.out", "w", stdout);
f();
fflush(stdout);
dup2(fd, fileno(stdout));
close(fd);
clearerr(stdout);
fsetpos(stdout, &pos); /* for C9X */
printf("stdout again\n");
}
f()
{
printf("stdout in f()");
}
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, (continued)
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Angus Leeming, 2006/01/09
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Jan-Åke Larsson, 2006/01/09
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Jan-Åke Larsson, 2006/01/09
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Angus Leeming, 2006/01/09
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Jan-Åke Larsson, 2006/01/11
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Jan-Åke Larsson, 2006/01/11
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Jan-Åke Larsson, 2006/01/11
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Angus Leeming, 2006/01/11
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Angus Leeming, 2006/01/09
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, David Kastrup, 2006/01/09
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX,
Enrico Forestieri <=
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Jan-Åke Larsson, 2006/01/11
- Re: [AUCTeX-devel] preview-latex, dvipng, and LyX, Enrico Forestieri, 2006/01/10