summaryrefslogtreecommitdiff
path: root/src/get_file.c
diff options
context:
space:
mode:
authorpants <jaron@kent-dobias.com>2016-09-08 11:54:06 -0400
committerpants <jaron@kent-dobias.com>2016-09-08 11:54:06 -0400
commitb74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11 (patch)
treec3fa46f10f6ae8604c4e784febc3eaa49b51b821 /src/get_file.c
parenta264723b23d9ad6c3cb13450a6cf4b131f8d7338 (diff)
downloadfuse_networks-b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11.tar.gz
fuse_networks-b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11.tar.bz2
fuse_networks-b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11.zip
cleaned up old files that don't matter
Diffstat (limited to 'src/get_file.c')
-rw-r--r--src/get_file.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/get_file.c b/src/get_file.c
deleted file mode 100644
index 9141631..0000000
--- a/src/get_file.c
+++ /dev/null
@@ -1,38 +0,0 @@
-
-#include "fracture.h"
-
-FILE *get_file(const char *prefix, unsigned int width, unsigned int crack,
- double beta, unsigned int iter, unsigned int num_iter,
- unsigned int num, bool read) {
- int prefix_len = strlen(prefix);
- int width_len = 1 + (int)log10(width);
- int crack_len;
- if (crack != 0) {
- crack_len = 1 + (int)log10(crack);
- } else {
- crack_len = 1;
- }
- int beta_len;
- if (beta > 1) {
- beta_len = 1 + (int)log10(beta) + 3;
- } else {
- beta_len = 4;
- }
- int iter_len = 1 + (int)log10(num_iter);
- int num_len = 1 + (int)log10(num);
- int num_underscores = 5;
-
- int len = prefix_len + width_len + crack_len + beta_len + iter_len + num_len +
- num_underscores + 4;
-
- char filename[len + 1];
- snprintf(filename, sizeof(filename), "%s_%u_%u_%.2f_%0*u_%u.txt", prefix,
- width, crack, beta, iter_len, iter + 1, num);
-
- char *mode = "w";
- if (read) {
- mode = "r";
- }
- FILE *file = fopen(filename, mode);
- return file;
-}