aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/write_file_size.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/write_file_size.py
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/scripts/write_file_size.py')
-rw-r--r--build/scripts/write_file_size.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/build/scripts/write_file_size.py b/build/scripts/write_file_size.py
new file mode 100644
index 0000000000..880fb90644
--- /dev/null
+++ b/build/scripts/write_file_size.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+import sys
+import os.path
+
+if __name__ == '__main__':
+ output = sys.argv[1]
+ size_sum = 0
+ for filename in sys.argv[2:]:
+ if os.path.exists(filename):
+ size_sum += os.path.getsize(filename)
+ else:
+ sys.stderr.write('write_file_size.py: {0}: No such file or directory\n'.format(filename))
+ sys.exit(1)
+ with open(output, 'w') as f:
+ f.write(str(size_sum))