diff --git a/encfs/encfs.cpp b/encfs/encfs.cpp index 68a8c17c..38968094 100644 --- a/encfs/encfs.cpp +++ b/encfs/encfs.cpp @@ -533,6 +533,15 @@ int encfs_open(const char *path, struct fuse_file_info *file) { return res; } +int encfs_create(const char *path, mode_t mode, struct fuse_file_info *file) { + int res = encfs_mknod(path, mode, 0); + if (res) { + return res; + } + + return encfs_open(path, file); +} + int _do_flush(FileNode *fnode) { /* Flush can be called multiple times for an open file, so it doesn't close the file. However it is important to call close() for some diff --git a/encfs/encfs.h b/encfs/encfs.h index 85b09db2..3a930b4f 100644 --- a/encfs/encfs.h +++ b/encfs/encfs.h @@ -76,6 +76,7 @@ int encfs_truncate(const char *path, off_t size); int encfs_ftruncate(const char *path, off_t size, struct fuse_file_info *fi); int encfs_utime(const char *path, struct utimbuf *buf); int encfs_open(const char *path, struct fuse_file_info *info); +int encfs_create(const char *path, mode_t mode, struct fuse_file_info *info); int encfs_release(const char *path, struct fuse_file_info *info); int encfs_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *info); diff --git a/encfs/main.cpp b/encfs/main.cpp index ab69992e..1d799a6c 100644 --- a/encfs/main.cpp +++ b/encfs/main.cpp @@ -605,7 +605,7 @@ int main(int argc, char *argv[]) { encfs_oper.init = encfs_init; encfs_oper.destroy = encfs_destroy; // encfs_oper.access = encfs_access; - // encfs_oper.create = encfs_create; + encfs_oper.create = encfs_create; encfs_oper.ftruncate = encfs_ftruncate; encfs_oper.fgetattr = encfs_fgetattr; // encfs_oper.lock = encfs_lock;