From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: recognizing a file by scanning it Date: Mon, 28 Apr 2008 05:02:13 +0200 Message-ID: <87lk2y65sa.fsf@ambire.localdomain> References: <87od7vr0kt.fsf@ambire.localdomain> <87abjfxb19.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1209351935 12831 80.91.229.12 (28 Apr 2008 03:05:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2008 03:05:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 28 05:06:10 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JqJgi-0001l4-4I for ged-emacs-devel@m.gmane.org; Mon, 28 Apr 2008 05:05:56 +0200 Original-Received: from localhost ([127.0.0.1]:40749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqJg1-00014B-Cl for ged-emacs-devel@m.gmane.org; Sun, 27 Apr 2008 23:05:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqJfw-000119-Kr for emacs-devel@gnu.org; Sun, 27 Apr 2008 23:05:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqJfv-0000z1-2P for emacs-devel@gnu.org; Sun, 27 Apr 2008 23:05:08 -0400 Original-Received: from [199.232.76.173] (port=32805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqJfu-0000ye-R3 for emacs-devel@gnu.org; Sun, 27 Apr 2008 23:05:06 -0400 Original-Received: from [151.61.143.83] (helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JqJfu-0008Io-5K for emacs-devel@gnu.org; Sun, 27 Apr 2008 23:05:06 -0400 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1JqJd7-0001Wo-W7; Mon, 28 Apr 2008 05:02:14 +0200 In-Reply-To: <87abjfxb19.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Mon, 28 Apr 2008 06:06:42 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96041 Archived-At: () "Stephen J. Turnbull" () Mon, 28 Apr 2008 06:06:42 +0900 file(1) contains a rather complete set of such heuristics and has been stable for a long time. AFAIK libmagic is free and GPL-compatible. Yes, i believe so. My concern w/ using libmagic would be portability, and handling the case where libmagic is not available. I envision the feature to be non-optional. Also, it might be nice if you could call this facility from coding systems (after all, what else is a BOM but file magic?) This kind of thing really doesn't need to be in Lisp, and might benefit from being in C. Certainly, in C it can be much faster. thi