[Webkit-unassigned] [Bug 36938] Add basic FileSystem operations for FileReader/FileWriter support
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Apr 6 15:07:03 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=36938
--- Comment #11 from Kinuko Yasuda <kinuko at chromium.org> 2010-04-06 15:07:02 PST ---
Thanks for reviewing very quickly.
(In reply to comment #9)
> (From update of attachment 52666 [details])
> > +bool truncateFile(PlatformFileHandle handle, long long offset)
> Why do we need to introduce truncateFile? I am not seeing any reference in your
> FileWriter patch.
I haven't implemented in my private patch yet but FileWriter spec has
truncate() API and I anticipate I will need that.
> > +int writeToFile(PlatformFileHandle handle, const char* data, int length)
> > +{
> > + int totalBytesWritten = 0;
> > + while (totalBytesWritten < length) {
> > + int bytesWritten = write(handle, data + totalBytesWritten, static_cast<size_t>(length - totalBytesWritten));
> > + if (bytesWritten < 0 && errno != EINTR)
> > + return -1;
> > + if (errno != EINTR)
> It would be safe to say:
> if (bytesWritten > 0)
> > + totalBytesWritten += bytesWritten;
Good suggestion, fixed it (here and in readFrmoFile).
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list