summaryrefslogtreecommitdiffstats
path: root/libutils/file.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix the WriteStringToFile overload that takes mode/owner/group.Elliott Hughes2015-02-171-2/+17
| | | | | | | | | | The actual bug is == instead of !=, but the real cause was me trying to be too clever. This patch switches to much simpler code, and -- since the intended use of this code is security anyway -- adds logging if anything goes wrong. Bug: 19361774 Change-Id: If2af07d31a5002f9010b838247b691f6b28bdfb1
* Clean up reading and writing in init.Elliott Hughes2015-02-061-22/+23
| | | | | | | | | | | | | This isn't particularly useful in and of itself, but it does introduce the first (trivial) unit test, improves the documentation (including details about how to debug init crashes), and made me aware of how unpleasant the existing parser is. I also fixed a bug in passing --- unless you thought the "peboot" and "pm" commands were features... Bug: 19217569 Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
* Fix Windows build.Elliott Hughes2015-02-041-0/+2
| | | | | | | Only two days in, and I'm already really regretting putting this code somewhere that builds for Mac OS and Windows... Change-Id: I576ee4a9e647e10dc2d47c7e1e38aedee2bf404c
* Add a WriteStringToFile overload that cares about permissions.Elliott Hughes2015-02-041-8/+35
| | | | Change-Id: I857a80b61768d4e9610bdd149eff2d9d8e48d2c0
* Fix Mac build.Elliott Hughes2015-02-031-0/+2
| | | | | | | I knew I should have created a new library that doesn't build for the Mac or Windows rather than adding to libutils... Change-Id: I7c07eaa93affb7e83d4da384f03652c39065562a
* Add Google-style ReadFileToString and WriteStringToFile.Elliott Hughes2015-02-031-0/+68
Bug: 19217569 Change-Id: I64789d3fa6777ee30a324cdf00fdc275c1230e1b