From d4b8ed6b6e54465d0d9bae74ccf565e2cc7d9c16 Mon Sep 17 00:00:00 2001 From: yhoogstrate Date: Wed, 26 Feb 2020 12:50:07 +0100 Subject: [PATCH] added decoy func --- CMakeLists.txt | 2 +- Changelog | 5 +++++ src/fuse.cpp | 21 ++++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe932cab..4c0b219e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ project(fastafs) # Do this once in a while - find different bugs #set(CMAKE_CXX_COMPILER "clang++") -set(PROJECT_VERSION "1.7.2") +set(PROJECT_VERSION "1.7.3") set(PACKAGE_URL "https://github.com/yhoogstrate/fastafs") set(PACKAGE_BUGREPORT "${PACKAGE_URL}/issues") diff --git a/Changelog b/Changelog index c4f984b6..6f7d541d 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,8 @@ +2020-20-26 Youri Hoogstrate + + * v1.7.3 + * Small decoy function added for basic snakemake compatiblity + 2020-02-04 Youri Hoogstrate * v1.7.2 diff --git a/src/fuse.cpp b/src/fuse.cpp index 6d66dfa8..3021be8d 100644 --- a/src/fuse.cpp +++ b/src/fuse.cpp @@ -36,6 +36,7 @@ struct fuse_instance { ffs2f_init *cache_p0;// cache with padding of 0; used by API '/seq/chr1:123:456' bool from_fastafs; // if false, from 2bit + // ucsc2bit ucsc2bit *u2b; @@ -44,6 +45,8 @@ struct fuse_instance { uint32_t padding; bool allow_masking; int argc_fuse; + + timespec ts[2]; // access and modify time }; @@ -286,6 +289,22 @@ static int do_getxattr(const char* path, const char* name, char* value, size_t s } +// decoy function to not throw an error if snakemake access this +// as it doesn't have access to fi it is practically not possible to do a generic update +static int do_utimens(const char *path, const struct timespec ts[2]) // seems it doesn't understand 'fuse_file_info ?' , struct fuse_file_info *fi) +{ + //(void) fi; + //int res; + + /* don't use utime/utimes since they follow symlinks */ + //res = utimensat(0, path, ts, AT_SYMLINK_NOFOLLOW); + // set fi data to ts + //if (res == -1) + //return -errno; + + return 0; +} + void do_destroy(void *pd) { @@ -357,7 +376,7 @@ fuse_operations operations = { nullptr, // int (*ftruncate) (const char *, off_t, struct fuse_file_info *); nullptr, // int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *); nullptr, // int (*lock) (const char *, struct fuse_file_info *, int cmd, struct flock *); - nullptr, // int (*utimens) (const char *, const struct timespec tv[2]); + do_utimens, // int (*utimens) (const char *, const struct timespec tv[2]); // sets / updates access and modify time values nullptr, // int (*bmap) (const char *, size_t blocksize, uint64_t *idx); // nullptr, // int (*ioctl) (const char *, int cmd, void *arg, struct fuse_file_info *, uint32_t flags, void *data); // nullptr, // int (*poll) (const char *, struct fuse_file_info *, struct fuse_pollhandle *ph, unsigned *reventsp);