Comments (7)
Yup, that's an error. Looks like the Chrome implementation was missing the [EnforceRange]
in our idl file, which caused this to slip through the cracks. I have patch up to fix this and update the WPT
from fs.
After thinking about this a bit more, we might want to consider what the other end of the target range looks like, as well. Using an unsigned long long
makes sense to guarantee the value is non-negative, but most operating systems do not support offsets of more than the max long long
(off_t
is signed, for example). And 32-bit OSes may not even support more than the max long
.
Should we have language in the spec about what to do if the value is not valid for file operations on that OS? (InvalidModificationError
? TypeError
?)
from fs.
The WPT has been updated to throw a TypeError
if a negative value is passed, but I'll leave this issue open for the discussion of what we should do when an offset is passed which is too large for the underlying OS to handle
from fs.
Using a TypeError
as well seems reasonable.
from fs.
Thoughts on NotSupportedError
, since whether the value is supported as an offset may depend on the OS? (sorry, I'm not sure whether this is consistent with how the error code is used elsewhere.) Otherwise TypeError
seems reasonable to me :)
from fs.
That could work as well, to some extent this depends on whether we expect web developers to branch on the exception type. If we don't, using the generic exception is preferred (that's TypeError
to be clear).
I don't think we'd expect web developers to branch here. At least not based on this, but I could be mistaken. It seems to me that if the OS limit needs to be exposed there are better ways to do that, e.g., through a static getter.
from fs.
Good point! I'll update Chrome's implementation to make this a TypeError
. We probably can't write a WPT asserting this (since some OSes/browsers could support values above the max signed long long) but we should add a note in the spec (#21).
from fs.
Related Issues (20)
- proposals/MultipleReadersWriters.md
- File and Directory Watch Functionality for the FileSystem API HOT 1
- Clarify behavior of `createWritable()` when the corresponding file does not exist HOT 1
- Add a `FileSystemHandle.create()` method to create self
- Define File's type better (getFile()) HOT 6
- Define the Bucket File System in terms of the Storage spec
- Why is WirteParams's data both optional and nullable?
- Editorial: string formatting
- Support locking of directory entries
- Require taking a lock to remove an entry HOT 1
- FYI: TPAC 2023 WICG breakout session
- Temporary directories/files HOT 2
- New Modes of Creating a FileSystemWritableFileStream HOT 3
- No explicit file lock release when `write()` throws an exception HOT 3
- Origin Private File System – identification of buckets (similarly to FAS API showSaveFilePicker) HOT 3
- Using F_FULLFSYNC for flush() causing slow performance on Mac HOT 1
- getFile() shouldn't require a copy of the underlying data HOT 5
- Add a FileSystemFileHandle copy method
- Hyuuhhh
- POSIX style path access for OPFS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs.