diff --git a/README.md b/README.md index 4e46885..1755f05 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,12 @@ Defines verbosity used for stdout messages. Default value is `INFO`. Where to store temporary files - offline copies of DDL statements while their files are open. `/tmp` location is used by default. All files created by **ddlfs** have names prefixed by `ddlfs-` in this folder. +**`filesize=`**`0` +All `.sql` files report file size as specified by this parameter - unless if file is currently open; correct file size +is always returned for currently open files. Usign default value `0` (or not specifying this parameter) should be OK for +most cases, however, some applications refuse to read files with zero length and only read files up to returned file size. +If you use such application with `ddlfs` specify this parameter to be greater than any database object (`10485760`, this +is 10mb, should be enough in most cases). Tips for VIM ------------ diff --git a/docs/ddlfs.man b/docs/ddlfs.man index 48baebc..abd1d89 100644 --- a/docs/ddlfs.man +++ b/docs/ddlfs.man @@ -50,4 +50,14 @@ Defines verbosity level used for stdout messages. Where to store temporary files - offline copies of DDL statements while their files are open. \fI/tmp\fR location is used by default. All files created by \fBddlfs\fR are prefixed by ddlfs- in this folder. +.TP +.BR filesize=\fI0\fR +All .sql files report file size as specified by this parameter - unless if file is currently open; correct file size +is always returned for currently open files. Usign default value 0 (or not specifying this parameter) should be OK for +most cases, however, some applications refuse to read files with zero length and only read files up to returned file size. +If you use such application with `ddlfs` specify this parameter to be greater than any database object (`10485760`, +this is 10mb, should be enough in most cases). + + + diff --git a/src/config.c b/src/config.c index 8eafbea..55bf78e 100644 --- a/src/config.c +++ b/src/config.c @@ -19,6 +19,7 @@ static struct fuse_opt ddlfs_opts[] = { MYFS_OPT("schemas=%s", schemas, 1), MYFS_OPT("loglevel=%s", loglevel, 1), MYFS_OPT("temppath=%s", temppath, 1), + MYFS_OPT("filesize=%d", filesize, 1), MYFS_OPT("lowercase", lowercase, 1), MYFS_OPT("nolowercase", lowercase, 0), @@ -95,6 +96,7 @@ struct fuse_args parse_arguments(int argc, char *argv[]) { logmsg(LOG_DEBUG, ".. schemas : [%s]", g_conf.schemas); logmsg(LOG_DEBUG, ".. lowercase: [%d]", g_conf.lowercase); logmsg(LOG_DEBUG, ".. temppath : [%s]", g_conf.temppath); + logmsg(LOG_DEBUG, ".. filesize : [%d]", g_conf.filesize); logmsg(LOG_DEBUG, "."); return args; diff --git a/src/config.h b/src/config.h index 8e186a1..d57f847 100644 --- a/src/config.h +++ b/src/config.h @@ -11,6 +11,7 @@ struct s_global_config { char *database; char *schemas; int lowercase; + int filesize; char *loglevel; } g_conf; diff --git a/src/fuse-impl.c b/src/fuse-impl.c index ba983f5..78dab0f 100644 --- a/src/fuse-impl.c +++ b/src/fuse-impl.c @@ -18,6 +18,7 @@ __asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); #include "vfs.h" #include "logging.h" #include "query.h" +#include "config.h" #include "fuse-impl.h" #define DEPTH_SCHEMA 0 @@ -129,7 +130,7 @@ int fs_getattr( const char *path, struct stat *st ) } struct stat tmp_st; - tmp_st.st_size = 0; + tmp_st.st_size = g_conf.filesize; if (depth == DEPTH_MAX) { char *fname;