add file length check

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>