1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:37:45 +00:00

LibCore: Convert CFile to ObjectPtr

This commit is contained in:
Andreas Kling 2019-09-21 20:50:06 +02:00
parent 31b38ed88f
commit 8d550c174e
30 changed files with 135 additions and 134 deletions

View file

@ -8,12 +8,12 @@ int main(int argc, char** argv)
{
(void)argc;
(void)argv;
CFile f("/proc/dmesg");
if (!f.open(CIODevice::ReadOnly)) {
fprintf(stderr, "open: failed to open /proc/dmesg: %s", f.error_string());
auto f = CFile::construct("/proc/dmesg");
if (!f->open(CIODevice::ReadOnly)) {
fprintf(stderr, "open: failed to open /proc/dmesg: %s", f->error_string());
return 1;
}
const auto& b = f.read_all();
const auto& b = f->read_all();
for (auto i = 0; i < b.size(); ++i)
putchar(b[i]);
return 0;