1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +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

@ -95,13 +95,13 @@ int main(int argc, char* argv[])
line_count = DEFAULT_LINE_COUNT;
}
CFile f(values[0]);
if (!f.open(CIODevice::ReadOnly)) {
fprintf(stderr, "Error opening file %s: %s\n", f.filename().characters(), strerror(errno));
auto f = CFile::construct(values[0]);
if (!f->open(CIODevice::ReadOnly)) {
fprintf(stderr, "Error opening file %s: %s\n", f->filename().characters(), strerror(errno));
exit(1);
}
bool flag_follow = args.is_present("f");
auto pos = find_seek_pos(f, line_count);
return tail_from_pos(f, pos, flag_follow);
auto pos = find_seek_pos(*f, line_count);
return tail_from_pos(*f, pos, flag_follow);
}