whatwg / fs

File System Standard
https://fs.spec.whatwg.org/
Other
225 stars 19 forks source link

Describe flushing + don't flush on close #85

Closed a-sully closed 1 year ago

a-sully commented 1 year ago

Fixes #71

I'm happy to bikeshed the exact text for flushing in the comments.

Also updates the close() method's description to not mention flushing. I didn't realize this language existed, but it turns out none (!) of the browsers actually flush the file during close(), which matches the behavior of most underlying OSes when closing a file descriptor anyways.

Fixing the close() algorithm (to address #83) will be done in a follow-up


Preview | Diff

a-sully commented 1 year ago

Flush text bikshedding

I tried to make the text specific enough to be useful without prescribing implementation details or being too OS-specific (I assume we shouldn't explicitly mention fdatasync(), for example?)

"file content" is intentional here because it gives user agents the freedom to not flush file metadata if they so choose. I'm not sure if that should be made explicit?

a-sully commented 1 year ago

Addressed all comments in the latest patch. Thank you for the review!