add encfs_create, fixes #162

This commit is contained in:
Valient Gough 2016-04-26 21:49:27 -07:00
parent 05a749d32f
commit aacce54f42
No known key found for this signature in database
GPG Key ID: B515DCEB95967051
3 changed files with 11 additions and 1 deletions

View File

@ -533,6 +533,15 @@ int encfs_open(const char *path, struct fuse_file_info *file) {
return res; 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) { int _do_flush(FileNode *fnode) {
/* Flush can be called multiple times for an open file, so it doesn't /* 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 close the file. However it is important to call close() for some

View File

@ -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_ftruncate(const char *path, off_t size, struct fuse_file_info *fi);
int encfs_utime(const char *path, struct utimbuf *buf); int encfs_utime(const char *path, struct utimbuf *buf);
int encfs_open(const char *path, struct fuse_file_info *info); 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_release(const char *path, struct fuse_file_info *info);
int encfs_read(const char *path, char *buf, size_t size, off_t offset, int encfs_read(const char *path, char *buf, size_t size, off_t offset,
struct fuse_file_info *info); struct fuse_file_info *info);

View File

@ -605,7 +605,7 @@ int main(int argc, char *argv[]) {
encfs_oper.init = encfs_init; encfs_oper.init = encfs_init;
encfs_oper.destroy = encfs_destroy; encfs_oper.destroy = encfs_destroy;
// encfs_oper.access = encfs_access; // encfs_oper.access = encfs_access;
// encfs_oper.create = encfs_create; encfs_oper.create = encfs_create;
encfs_oper.ftruncate = encfs_ftruncate; encfs_oper.ftruncate = encfs_ftruncate;
encfs_oper.fgetattr = encfs_fgetattr; encfs_oper.fgetattr = encfs_fgetattr;
// encfs_oper.lock = encfs_lock; // encfs_oper.lock = encfs_lock;