On 24/05/12 07:14, Ford, Kevin wrote:
> I finally had occasion today (read: remembered) to see if the *nix "file" command would recognize a MARC record file. I haven't tested extensively, but it did identify the file as MARC21 Bibliographic record. It also correctly identified a MARC21 Authority Record. I'm running the most recent version of Ubuntu (12.04 - precise pangolin).
> I write because the inclusion of a "file" MARC21 specification rule in the magic.db stems from a Code4lib exchange that started in March 2011  (it ends in April if you want to go crawling for the entire thread).
A couple of warnings about the unix file command
(a) it only looks at the start of the file. This is great because it
works fast on big files. This is dreadful because it can't warn you that
everything after the first 10k of a 2GB file is corrupt or a 1k MARC
file is pre-pended to a 400GB astronomy data file.
(b) it is not uncommon for a file to match multiple file types. This can
cause problems when using file to check whether inputs to a program are
actually the type the program is expecting.
(c) some platforms have been notoriously slow to add new definitions,
ubuntu is not such a platform.
Library Technology Services http://www.victoria.ac.nz/library/