mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-04-19 04:09:45 +00:00
Minor changes
This commit is contained in:
parent
33c5443794
commit
dd12a4b42f
3 changed files with 28 additions and 23 deletions
|
@ -1,7 +1,5 @@
|
|||
#include <zmq.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include "utils.h"
|
||||
|
||||
|
@ -68,15 +66,17 @@ int main (int argc, char *argv [])
|
|||
double size_mib=size/(1024*1024);
|
||||
printf("Data received: key=%s client=%s interval=%ld msgsize=%.2lfMiB\n",key, client, interval,size_mib);
|
||||
char path[STATIC_LEN]="";
|
||||
//sprintf(path,"%s/%s_%s_%ld",cdatadir,key,client,interval);
|
||||
// Create dir if not exists:
|
||||
sprintf(path,"%s/%s/%s/",cdatadir,key,client);
|
||||
if(!DIR_EXISTS(path)){
|
||||
mkdirp(path);
|
||||
}
|
||||
// Now open output file:
|
||||
sprintf(path,"%s/%s/%s/%ld",cdatadir,key,client,interval);
|
||||
fptr=fopen(path,"a");
|
||||
}
|
||||
|
||||
// Write all the measurements:
|
||||
if(line>4){
|
||||
fwrite(token, strlen(token), 1, fptr);
|
||||
fwrite("\n",1,1,fptr);
|
||||
|
@ -88,8 +88,6 @@ int main (int argc, char *argv [])
|
|||
fclose(fptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
zmq_close (subscriber);
|
||||
zmq_ctx_destroy (context);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue