/
niceSOFT
/
zstd
Обзор
Документация
Войти
/
niceSOFT
/
zstd
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
tests/check_size.py
31 строка
922 B
W. Felix Handte
Update Copyright Headers 'Facebook' -> 'Meta Platforms'
20 дек 2022, 20:37
20 дек 2022, 20:37
8927f98
Код
Авторство
О чём код?
#!/usr/bin/env python3 # ################################################################ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). # You may select, at your option, one of the above-listed licenses. # ################################################################ import os import subprocess import sys if len(sys.argv) != 3: print(f"Usage: {sys.argv[0]} FILE SIZE_LIMIT") sys.exit(1) file = sys.argv[1] limit = int(sys.argv[2]) if not os.path.exists(file): print(f"{file} does not exist") sys.exit(1) size = os.path.getsize(file) if size > limit: print(f"file {file} is {size} bytes, which is greater than the limit of {limit} bytes") sys.exit(1)