summaryrefslogtreecommitdiffstats
path: root/libutils/file.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "Create libbase.""Dan Albert2015-03-161-115/+0
| | | | | | This reverts commit a7870d88167f619e758b5bcd15b410d16da7c16b. (cherry picked from commit c007bc3856a4cf86b8f610eb045f26a9dedc2894)
* Revert "Create libbase."Nicolas Geoffray2015-03-161-0/+115
| | | | | | | | Breaks internal master. This reverts commit 98ff77204cef9bb8f0f27420833233622060a09e. Change-Id: I18dc6021cb43efff8aa88486c2d980dc2b8eedba
* Create libbase.Dan Albert2015-03-141-115/+0
| | | | | | | Move StringPrintf and the string based file I/O from libutils to libbase. Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
* 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