Re: gnome-vfs-mime-magic query

lör 2003-01-04 klockan 15.35 skrev Eugene O'Connor:
> Can anyone help me to understand what the &pattern_mask is in the
> gnome-vfs-mime-magic file? Perhaps someone could explain with an
> example, maybe this one:
> 0	string		BMxxxx\000\000 &0xffff00000000ffff	image/bmp
> What does the mask actually do?

The mask is used to identify the bits in the pattern that should be
included/skipped when compared to the file data. (& is the the bitwise
logical AND operation).

Your example

pattern B   M   x   x   x   x   \000  \000
mask    ff  ff  00  00  00  00  ff    ff

would translate to something like:

Files starting with "BM", 4 bytes with arbitrary 
values and \000 \000 are image/bmp

  - Jens

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