err_check,添加文件信息

This commit is contained in:
zzh 2025-12-14 21:29:14 +08:00
parent 49028547ac
commit f00e492c99
5 changed files with 7 additions and 7 deletions

View File

@ -338,7 +338,7 @@ HybridIndex* bwa_hyb_idx_load_from_disk(const char* idx_prefix) {
#define __load_hybrid_idx_code(suffix, data) \ #define __load_hybrid_idx_code(suffix, data) \
sec_time = realtime(); \ sec_time = realtime(); \
sprintf(fn, "%s%s", idx_prefix, suffix); \ sprintf(fn, "%s%s", idx_prefix, suffix); \
err_check_true(stat(fn, &st), 0); \ err_check_true(stat(fn, &st), 0, fn); \
fp = xopen(fn, "r"); \ fp = xopen(fn, "r"); \
data = (uint8_t*)malloc(st.st_size); \ data = (uint8_t*)malloc(st.st_size); \
err_fread_noeof(data, 1, st.st_size, fp); \ err_fread_noeof(data, 1, st.st_size, fp); \

View File

@ -23,7 +23,7 @@ HybridIndex* load_hybrid_idx(const char* prefix) {
#define __load_hybrid_idx_code(suffix, data) \ #define __load_hybrid_idx_code(suffix, data) \
sprintf(fn, "%s%s", prefix, suffix); \ sprintf(fn, "%s%s", prefix, suffix); \
err_check_true(stat(fn, &st), 0); \ err_check_true(stat(fn, &st), 0, fn); \
fp = xopen(fn, "r"); \ fp = xopen(fn, "r"); \
data = (uint8_t*)malloc(st.st_size); \ data = (uint8_t*)malloc(st.st_size); \
err_fread_noeof(data, 1, st.st_size, fp); \ err_fread_noeof(data, 1, st.st_size, fp); \

View File

@ -45,7 +45,7 @@ int shm_keep_hyb(const char* idx_prefix) {
perror("shm_open()"); \ perror("shm_open()"); \
return -1; \ return -1; \
} \ } \
err_check_true(stat(full_path, &st), 0); \ err_check_true(stat(full_path, &st), 0, full_path); \
if (ftruncate(shmid, st.st_size) < 0) \ if (ftruncate(shmid, st.st_size) < 0) \
return -1; \ return -1; \
idx_name_len = 8 + strlen(file_name) + 1; \ idx_name_len = 8 + strlen(file_name) + 1; \

View File

@ -2,7 +2,7 @@
#include "utils.h" #include "utils.h"
#if 0 #if 1
#define HYB_PAC_SUFFIX ".hyb.pac" #define HYB_PAC_SUFFIX ".hyb.pac"
#define HYB_SA_SUFFIX ".hyb.bytesa" #define HYB_SA_SUFFIX ".hyb.bytesa"
#define HYB_KMER_SUFFIX ".hyb.kmer" #define HYB_KMER_SUFFIX ".hyb.kmer"

View File

@ -81,9 +81,9 @@
#endif #endif
#endif #endif
#define err_check_true(ret_code, right_val) \ #define err_check_true(ret_code, right_val, err_str) \
if ((ret_code) != (right_val)) \ if ((ret_code) != (right_val)) \
err_fatal("err_check", "Value not right: True-Val %d\n", right_val) err_fatal("err_check", "Value not right: True-Val %d\n%s\n", right_val, err_str)
#define err_check_false(ret_code, err_val) \ #define err_check_false(ret_code, err_val) \
if ((ret_code) == (err_val)) \ if ((ret_code) == (err_val)) \
@ -93,7 +93,7 @@
do { \ do { \
FILE* fp = NULL; \ FILE* fp = NULL; \
struct stat st; \ struct stat st; \
err_check_true(stat(fn, &st), 0); \ err_check_true(stat(fn, &st), 0, fn); \
fp = xopen(fn, "r"); \ fp = xopen(fn, "r"); \
data = (uint8_t*)malloc(st.st_size); \ data = (uint8_t*)malloc(st.st_size); \
err_fread_noeof(data, 1, st.st_size, fp); \ err_fread_noeof(data, 1, st.st_size, fp); \