[gmx-users] xtc C programming

David van der Spoel spoel at xray.bmc.uu.se
Fri Feb 15 18:31:48 CET 2002


On Fri, 15 Feb 2002, Eviatar Tron wrote:

>Hi,
>Ive been trying to write a trajectory file using the 
>xtc functions, but even the most primitive program,
>which is just
>main()
>{
>  :
>  int xfp=open_xtc("Traj.xtc","w");
>  :
>  :
>  write_xtc(xfp,40,1,0.0,box,atoms,3.1);
>  close_xtc(xfp);
>  :
>}
>fails with a message:
>Fatal error: Trying to access non-open file 1075115271, in gmxfio.c, line 848
>
>the file descriptor assigned is 0, which seemd ok looking at xtcio.c

Strange, your code looks fine, except for the precision which should be
a power of 10 (not formallym but to make sense). 

Do you link the stuff with -lgmx?

Otherwise feel free to send the code to me.

Groeten, David.
________________________________________________________________________
Dr. David van der Spoel, 	Biomedical center, Dept. of Biochemistry
Husargatan 3, Box 576,  	75123 Uppsala, Sweden
phone:	46 18 471 4205		fax: 46 18 511 755
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://zorn.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the gromacs.org_gmx-users mailing list