c - Get the FUSE version string -


is there function returns fuse version string?

fuse_common.h has int fuse_version(void), returns major version, multiplied 10, plus minor version; both of derived #define values. (e.g., returns 27 on platform). i'm looking for, however, char* fuse_version(void) return 2.7.3.

as said yourself, version defined in fuse_common.h. if don't want use helper_version, @alexguitar said may write small program -- seems 2 first numbers (major , minor) available:

#include <fuse/fuse.h> #include <stdlib.h> #include <stdio.h>  char* str_fuse_version(void) {     static char str[10] = {0,0,0,0,0,0,0,0,0,0};     if (str[0]==0) {         int v = fuse_version();         int = v/10;         int b = v%10;         snprintf(str,10,"%d.%d",a,b);      }     return str; }   int main () {     printf("%s\n", str_fuse_version());     exit(exit_success); } 

note: should include fuse/fuse.h , not fuse_common.h; also, may need pass -d_file_offset_bits=64 when compiling.

$ gcc -wall fuseversiontest.c -d_file_offset_bits=64  -lfuse  $ ./a.out 2.9 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -