Vision filesystem - determining the file version



In some instances it is desirable to be able to use the file command to determine the version of a Vision file.  


If the Unix operating system is being used has a magic file then it is possible to add an entry to display the version of the Vision file.

First locate your magic file ie. $whereis magic

$magic: /usr/share/magic.mgc /usr/share/magic /usr/share/magic.mime /usr/share/ /usr/share/man/man5/magic.5.gz

In this instance the /usr/share/magic file would be edited to include the following code.

# Vision 2 file

0       ulong          0x10121416     Vision

>4      ushort         2              2 data file

# Vision 3 file

0       ubelong        0x10121416     Vision

>4      ubeshort       3              3 data file

# Vision 4/5 primary data segment

0       ubelong        0x10121419     Vision

>4      ubeshort       >3             %u data file segment #0

# Vision 4/5 secondary data segment

0       ubelong        0x10121417     Vision

>4      ubeshort       >3             %u data file segment

>6      ubeshort       >0             #%u

# Vision 4/5 index segment

0       ubelong        0x10121418     Vision

>4      ubeshort       >3             %u index file segment

>6      ubeshort       0              #0

>6      ubeshort       >0             #%u

**You may need to compile this file, check the man page on file.

Now when the file command is used it will output the version of the Vision file.

Old KB# 2787
Comment List
Related Discussions