[ox/claw] Add missing file
This commit is contained in:
parent
bd9e27f977
commit
66d7627ed8
30
deps/ox/src/ox/claw/readclaw.cpp
vendored
Normal file
30
deps/ox/src/ox/claw/readclaw.cpp
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2015 - 2023 gary@drinkingtea.net
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <ox/std/reader.hpp>
|
||||
#include <ox/std/trace.hpp>
|
||||
|
||||
#include "claw.hpp"
|
||||
|
||||
|
||||
int main(int argc, char **args) {
|
||||
if (argc > 2) {
|
||||
oxErr("Too many arguments");
|
||||
return -1;
|
||||
}
|
||||
auto const file = argc == 1 ? stdin : fopen(args[1], "r");
|
||||
if (fseek(file, 0, SEEK_END)) {
|
||||
oxErr("Could not get file size\n");
|
||||
return -2;
|
||||
}
|
||||
auto const size = static_cast<std::size_t>(ftell(file));
|
||||
oxDebugf("{}", size);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user