Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add encfs_create, fixes #162
  • Loading branch information
vgough committed Apr 27, 2016
1 parent 05a749d commit aacce54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions encfs/encfs.cpp
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions encfs/encfs.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion encfs/main.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit aacce54

Please sign in to comment.