X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=visual%2Fvisual.c;h=ce4ceaf97cbdd2fdf1873b2b84c35af92d1f67a7;hb=706aed2512544b99ff34308fdb673b19ee884ce0;hp=6ad527a8ee4100bc58a5e91e4dce746cf7fea942;hpb=710717c4033bc5b8eb34644914e762a2834ae345;p=physik%2Fposic.git diff --git a/visual/visual.c b/visual/visual.c index 6ad527a..ce4ceaf 100644 --- a/visual/visual.c +++ b/visual/visual.c @@ -25,7 +25,7 @@ int visual_init(t_visual *v,char *filebase) { memset(file,0,128+8); sprintf(file,"%s.scr",v->fb); - v->fd=open(file,O_WRONLY); + v->fd=open(file,O_WRONLY|O_CREAT|O_TRUNC); if(v->fd<0) { perror("open visual fd"); return -1; @@ -69,7 +69,7 @@ int visual_atoms(t_visual *v,double time,t_atom *atom,int n) { }; sprintf(file,"%s-%.15f.xyz",v->fb,time); - fd=open(file,O_WRONLY); + fd=open(file,O_WRONLY|O_CREAT|O_TRUNC); if(fd<0) { perror("open visual save file fd"); return -1; @@ -87,8 +87,8 @@ int visual_atoms(t_visual *v,double time,t_atom *atom,int n) { dprintf(v->fd,"zap\n"); /* write the actual data file */ - dprintf(fd,"Atoms at time %.15f\n",time); dprintf(fd,"%d\n",n); + dprintf(fd,"atoms at time %.15f\n",time); for(i=0;i