Descriptionmojo filesystem: Simplify full file reading/writing.
One common pattern that's coming up multiple times is that we want to
read or write the full contents of a file. The first attempt at an
interface to that had was put on the File object.
However, file seeking behaviour differs between platforms. Performing a
seek on an empty file is safe on posix and errors on Windows. And when
dealing with arbitrary File objects, we want to seek to the beginning
just in case there was any previous usage on the File object.
It was also cumbersome. The user was still responsible for opening the
file and closing it once they were done with it. Putting these
operations on Directory not only removes a bug, but also simplifies the
interface.
BUG=557405
Committed: https://crrev.com/fd918ae590f61f145d75c800abb8eb050ca32b06
Cr-Commit-Position: refs/heads/master@{#371845}
Patch Set 1 #Patch Set 2 : Unit tests are nice to haves. #Patch Set 3 : Further cleanup of pref store. #
Total comments: 4
Patch Set 4 : These sort of type things should be caught by the compiler... #Patch Set 5 : Remove check #Messages
Total messages: 13 (3 generated)
|