emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using libmagic in Emacs?


From: Eli Zaretskii
Subject: Re: using libmagic in Emacs?
Date: Thu, 20 Aug 2009 21:20:13 +0300

> From: "Stephen J. Turnbull" <address@hidden>
> Cc: address@hidden,
>     address@hidden,
>     address@hidden
> Date: Thu, 20 Aug 2009 13:50:13 +0900
> 
> Eli Zaretskii writes:
> 
>  > > I think the main interface should be just "file-magic", even if it's
>  > > not in file.el.  It's analogous to "file-attributes", etc.
>  > 
>  > Actually, I think the interface should be `file-type' or some such.
> 
> Seriously, "file-type" is a terrible, ambiguous name.  DOS vs. Unix,
> the extension of the file's name (!!), what program uses it, text
> vs. binary, MIME type, endianness of the platform, Unicode vs. legacy
> coding, copyleft vs. permissive vs. proprietary vs. public domain, I
> could go on.  Sure, it's about "files", but the "type" is what file(1)
> infers from magic numbers in the file, no more and no less ... and
> exactly the people you expect to say "huh?" will proceed to guess
> anything but the truth about the semantics of `file-type'.

Maybe so, but still "man file" shows this at the very first line:

       file - determine file type

> I suppose the more explicit `file-type-by-magic' might be better.

I'm okay with that as well, but maybe `file-type-by-magic-signature'
is even better (if we indeed want to advertise its inner workings).
But if this function will fall back on something else if libmagic is
not available, then I think this name is not a good one.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]