mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:37:36 +00:00
LibCore: Convert CFile to ObjectPtr
This commit is contained in:
parent
31b38ed88f
commit
8d550c174e
30 changed files with 135 additions and 134 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue