1 from __future__
import print_function, division
10 if len(sys.argv) != 3:
11 sys.exit(
"Invalid arguments: usage: python libsize.py file.so save.txt")
16 if not os.path.exists(lib):
17 sys.exit(
"Error: requested file ({}) does not exist".
format(lib))
19 libsize = os.path.getsize(lib)
21 print(
"------", os.path.basename(lib),
"file size:", libsize, end=
'')
23 if os.path.exists(save):
24 with open(save)
as sf:
25 oldsize = int(sf.readline())
28 change = libsize - oldsize
32 print(
" (change of {:+} bytes = {:+.2%})".
format(change, change / oldsize))
36 with open(save,
'w')
as sf:
37 sf.write(
str(libsize))
auto format(const std::locale &loc, const CharT *fmt, const Streamable &tp) -> decltype(to_stream(std::declval< std::basic_ostream< CharT > &>(), fmt, tp), std::basic_string< CharT >
void print(Args &&...args)