2023-02-04 23:11:02 +00:00
|
|
|
import { ERRNO } from "./errno.js"
|
|
|
|
|
|
|
|
class BaseFileSystem {
|
|
|
|
|
|
|
|
access(path, mode) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
getattr(path) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
readlink(path) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
symlink(target, linkpath) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
link(oldpath, newpath) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
rename(oldpath, newpath, flags) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
chmod(path, mode) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
chown(path, uid, gid) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
truncate(path, size, fd) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
|
|
|
}
|
|
|
|
|
|
|
|
fsync(path, isDataSync, fd) {
|
|
|
|
return 0;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
open(path, flags) {
|
|
|
|
return [ERRNO.ENOENT, 0];
|
|
|
|
}
|
|
|
|
|
|
|
|
mknod(path, mode, rdev) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create(path, mode) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return [ERRNO.EPERM, 0];
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
release(path, fd) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return 0;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unlink(path) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
read(path, size, offset, fd) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EBADF;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
write(path, data, offset, fd) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EBADF;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mkdir(path, mode) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
readdir(path) {
|
|
|
|
return ERRNO.ENOENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
rmdir(path) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.EPERM;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
statfs(path) {
|
2023-02-05 10:37:19 +00:00
|
|
|
return ERRNO.ENOSYS;
|
|
|
|
}
|
|
|
|
|
|
|
|
utimens(path, atime, mtime) {
|
|
|
|
return ERRNO.ENOSYS;
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getcreds() {
|
|
|
|
return "";
|
|
|
|
}
|
2023-02-05 10:37:19 +00:00
|
|
|
|
|
|
|
connectionstatechanged(state) {
|
|
|
|
// pass
|
|
|
|
}
|
2023-02-04 23:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { BaseFileSystem }
|