Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-21 00:35:49 +00:00

zapret-lib: add expected_ratio to z_readfile

This commit is contained in:
bol-van
2026-01-07 08:31:23 +03:00
parent a61895778b
commit 2def9397a0
2 changed files with 5 additions and 3 deletions

View File

@@ -3067,10 +3067,11 @@ function readfile(filename)
Читает весь файл. Вызывается error в случае ошибки при открытии или чтении файла.
```
function z_readfile(filename)
function z_readfile(filename, expected_ratio)
```
Автоматически определяет является ли файл gzip. Если да - расжимает, если нет - читает без изменений. Вызывается error в случае ошибки при открытии или чтении файла.
expected_ratio - ожидаемое соотношение длины разжатых данных к длине сжатых данных (по умолчанию 4).
```
function writefile(filename, data)