Open Bug 660148 Opened 13 years ago Updated 2 years ago

Emulate WebKit behavior for File objects whose underlying file changes

Categories

(Core :: DOM: File, enhancement)

enhancement

Tracking

()

People

(Reporter: khuey, Unassigned)

References

(Depends on 4 open bugs)

Details

WebKit observes files on the disk and changes the File object (AIUI, to a zero-length File) if the file changes on the disk.  We should do the same.
This is about nsIDOMFile, not nsIFile, right?
If we implement such behavior, I hope it gets specified in File API.
Right, this is about nsIDOMFile.
Just gotta be careful to maintain run-to-completion semantics. I.e file.size == file.size should always return true.

In fact, I wonder if we should ever touch the size at all and instead add a .invalid member. And make reads fail (asynchronously) when that member is true.
I think this is a duplicate of something baku is working on.
Assignee: khuey → nobody
Flags: needinfo?(amarchesini)
I and Jonas already discussed this. File API doesn't support the changing of size and lastModified attributes.
I want to see the spec changes before touching our code. Annevk, can you help me with this?

A couple of months ago I was working on a nsIFileWatcherService: a service able to detect OS file changes.  The plan was to invalidate Blob/Files. But we can use the same component for updating size/lastModified attributes instead.
Flags: needinfo?(amarchesini) → needinfo?(annevk)
I filed https://github.com/w3c/FileAPI/issues/47.
Flags: needinfo?(annevk)
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Type: defect → enhancement
Component: DOM: Core & HTML → DOM: File
Priority: P3 → --
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.