[ZODB-Dev] detect zodb with the unix tool 'file' (contrib)

Jim Fulton jim at zope.com
Tue Sep 6 08:20:48 EST 2011


2011/9/5 Stéphane Blondon <stephane.blondon at gmail.com>:
> Hello,
>
> at work, we use Zodb to store data. I have found that `file` (the
> classic Unix tool) doesn't detect properly the database. I fixed
> easily this problem by inserting this line in /etc/magic:
> 0       string  FS21    Zope Database (data)
>
> Then, in a terminal, I have this behaviour:
>
> stephane at foehn:~$ file -m magic demo.db
> demo.db: Zope Database (data)
>
> It's what I wanted. Now, I plan to send it to the maintainer of `file`
> in order it will be available to every one in the future. To this
> goal, I have several questions:
>
>  - Is there a better mailing list for this topic?

No.

>  - Do you think improvements about this line (improvement in the
> description, support other versions of Zodb, etc.)?

Yes.  It should say:

  Zope Object Database File Storage (data)

The "FS21" magic string is specific to that particular
storage. There are other storages for ZODB.

>  - Other remarks?

Thanks.  I bothered to include a magic string in the
File Storage design, but never took it any farther than
that.

If you want, you could also define the "ZEC3" magic string
for ZEO cache files.  Not sure what the best description for that
might be.  Maybe "Zope Object Database Client Cache File".

> Thanks for all your work,

Thanks for following up on this.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton


More information about the ZODB-Dev mailing list