From af92dfdad8b8f2e8d35a1959832a3b6939261d9f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 15 Feb 2017 17:23:19 -0800 Subject: Teach file(1) about bzip2 files. If we can read and write bzip2 files, we should be able to identify them too... --- toys/posix/file.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toys/posix/file.c') diff --git a/toys/posix/file.c b/toys/posix/file.c index bab59e57..c7c72cd1 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -249,6 +249,8 @@ static void do_regular_file(int fd, char *name, struct stat *sb) if (ver) xprintf(", requires at least v%d.%d to extract", ver/10, ver%10); xputc('\n'); + } else if (len>4 && strstart(&s, "BZh") && isdigit(*s)) { + xprintf("bzip2 compressed data, block size = %c00k\n", *s); } else { char *what = 0; int i, bytes; -- cgit v1.2.3