Skip to content

Commit

Permalink
added decoy func
Browse files Browse the repository at this point in the history
  • Loading branch information
yhoogstrate committed Feb 26, 2020
1 parent c2d8438 commit d4b8ed6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
21 changes: 20 additions & 1 deletion src/fuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,6 +45,8 @@ struct fuse_instance {
uint32_t padding;
bool allow_masking;
int argc_fuse;

timespec ts[2]; // access and modify time
};


Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d4b8ed6

Please sign in to comment.