Hacker News new | ask | show | jobs
by yutijke 980 days ago
Looks like clickbait to me. OPFS is not a real filesystem. It's basically indexedDB with filesystem-like characteristics. It does not give you access to the host filesystem.

The File System access API can do that, but it needs the user to grant permissions for each file or directory accessed separately, and this permission cannot be persisted between sessions. So it is a constant nuisance and cannot be used to create an ergonomic mostly local web application.

1 comments

What are the limitations of OPFS not being a real file system?

100% agree that the file system API ergonomics make it unusable as the storage layer for a local-first application. OPFS seems promising though, which is why I ask the above.

As the sibling comment by eternityforest says, OPFS does not create real files on your file system. It is backed by sqlite or some other embedded key value store.

So, if you want to backup your webapp data, you cannot use any filesystem backup tool.

And since OPFS cannot access your local files you cannot use it for webapps that largely use local file system data.

Something like scoped storage would have been great. Each webapp gets a separate directory where they can store your data. Easy to backup and you can also drop any local files or directory in there with existing OS tools.

Thanks for elaborating, that makes sense.

Historically WebSQL would drop a real live SQLite database onto the disk (in some application support directory for the browser) which was very convenient for exactly this use case.

It's unfortunate that's no longer the case.

Lack of accessibility outside the app. It's harder to back up or make external tools that integrate.