Skip to content

Commit

Permalink
update chown example
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroModel committed Nov 27, 2024
1 parent 8552caa commit 6cf7802
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/0036.at/chown.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ int main(int argc, char **argv)
::std::uint_least64_t o;
::std::uint_least64_t g;

::fast_io::ibuffer_view ibv{argv[2], argv[2] + ::fast_io::cstr_len(argv[2])};
::fast_io::scan(ibv, ::fast_io::mnp::hex_get<8>(o), ::fast_io::mnp::hex_get<8>(g));
auto const [p1,e1]= ::fast_io::parse_by_scan(argv[2], argv[2] + ::fast_io::cstr_len(argv[2]), ::fast_io::mnp::hex_get<8>(o));
if (e1 != ::fast_io::parse_code::ok)
{
::fast_io::throw_parse_code(e1);
}
auto const [p2, e2] = ::fast_io::parse_by_scan(argv[3], argv[3] + ::fast_io::cstr_len(argv[3]), ::fast_io::mnp::hex_get<8>(g));
if (e2 != ::fast_io::parse_code::ok)
{
::fast_io::throw_parse_code(e2);
}
::fast_io::native_fchownat(::fast_io::at_fdcwd(), fast_io::mnp::os_c_str(argv[1]), o, g);
}
#if __cpp_exceptions
Expand Down

0 comments on commit 6cf7802

Please sign in to comment.