From: Charles McAnany (vmdnamd_at_charlesmcanany.com)
Date: Fri Jan 29 2016 - 11:13:40 CST

I'm currently only using psfplugin, but I might want to do .prmtop at a
later time.
If you'd like, I can go through all the plugin source and change all
printf( calls to something like fprintf(vmstdout, and give you a patch.
Then you could
#ifndef vmdstdout
#define vmdstdout stdout
#endif

in vmdplugin.h (or wherever it's appropriate) so that the existing behavior
is maintained by default for any programs that depend on it, and I can just
add a -Dvmdstdout=stderr to my makefile.
Cheers,
Charles.

On Thu, Jan 28, 2016 at 5:11 PM, John Stone <johns_at_ks.uiuc.edu> wrote:

> Do you only need this for the PSF plugin, or are you going to be trying to
> do stdout type output for others too?
>
> Cheers,
> John
>
> On Thu, Jan 28, 2016 at 01:23:46PM -0500, Charles McAnany wrote:
> > Friends,
> > I'm building a program that should write a .psf file to stdout
> (literally,
> > open_file_write("/proc/self/fd/1", "psf", natoms); and similar for
> other
> > platforms), and I'm sort of confused by the mix of printf( and
> > fprintf(stderr, in plugins/molfile_plugin/src/psfplugin.c. It seems
> that
> > about a third of the errors are sent to stdout and the rest to stderr.
> >
> > For a program that writes a psf to stdout, this is sort of irritating
> > because I have to either taint the vmd source by changing all the
> printf(s
> > to fprintf(stderr,s or make a great fuss with file descriptors (which
> is
> > also a portability problem).
> >
> > If this would be a simple fix, I'd really appreciate it. Of course,
> if it
> > would break something in vmd (like sending messages to the shell
> rather
> > than the tk console), it's a pretty minor request compared to the
> > usability of vmd. =)
> >
> > Cheers,
> > Charles McAnany.
>
> --
> NIH Center for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> http://www.ks.uiuc.edu/Research/vmd/
>