1
0
mirror of https://github.com/falk-werner/webfuse synced 2026-10-23 13:19:15 +00:00

add javascript example

This commit is contained in:
Falk Werner
2023-02-05 11:37:19 +01:00
parent 17d6275d96
commit acbcbc1d97
10 changed files with 244 additions and 70 deletions

View File

@@ -27,15 +27,19 @@ class BaseFileSystem {
}
chmod(path, mode) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
chown(path, uid, gid) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
truncate(path, size, fd) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
fsync(path, isDataSync, fd) {
return 0;
}
open(path, flags) {
@@ -43,31 +47,31 @@ class BaseFileSystem {
}
mknod(path, mode, rdev) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
create(path, mode) {
return [ERNNO.ENOEND, 0];
return [ERRNO.EPERM, 0];
}
release(path, fd) {
return ERRNO.ENOENT;
return 0;
}
unlink(path) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
read(path, size, offset, fd) {
return ERRNO.ENOENT;
return ERRNO.EBADF;
}
write(path, data, offset, fd) {
return ERRNO.ENOENT;
return ERRNO.EBADF;
}
mkdir(path, mode) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
readdir(path) {
@@ -75,16 +79,24 @@ class BaseFileSystem {
}
rmdir(path) {
return ERRNO.ENOENT;
return ERRNO.EPERM;
}
statfs(path) {
return ERRNO.ENOENT;
return ERRNO.ENOSYS;
}
utimens(path, atime, mtime) {
return ERRNO.ENOSYS;
}
getcreds() {
return "";
}
connectionstatechanged(state) {
// pass
}
}
export { BaseFileSystem }