mojo 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 Review URL: https://codereview.chromium.org/1634293002 Cr-Commit-Position: refs/heads/master@{#371845}
Showing
Please register or sign in to comment