How can I properly identify dL4 and UniBasic files using the Unix file command?
The Unix file command can properly identify dL4 and UniBasic files by adding lines such as these to the /etc/magic file:
| 0 | string | SAVE | uniBasic saved BASIC program |
| 0 | string | SYST | uniBasic system BASIC program |
| 0 | string | INDX | uniBasic indexed data file |
| >20 | short | >0 | - record length = %d |
| 0 | string | DATA | uniBasic data file |
| >20 | short | >0 | - record length = %d |
| 0 | string | ITEM | uniBasic formatted item file |
| >20 | short | >0 | - record length = %d |
| 0 | string | CONT | uniBasic contiguous file |
| >20 | short | >0 | - record length = %d |
| 0 | byte | 0x61 | c-tree key file |
| 0 | long | 0x1919ba2e | Portable or Universal Contiguous file |
| 0 | long | 0x2eba1919 | Portable or Universal Contiguous file |
| 0 | long | 0x1919ba2c | Portable or Universal Formatted file |
| 0 | long | 0x2cba1919 | Portable or Universal Formatted file |
| 0 | long | 0x1919ba32 | Portable or Universal Huge Contiguous file |
| 0 | long | 0x32ba1919 | Portable or Universal Huge Contiguous file |
| 0 | long | 0x1919ba31 | Portable or Universal Huge Formatted file |
| 0 | long | 0x31ba1919 | Portable or Universal Huge Formatted file |
| 0 | long | 0x1919ba2b | dL4 2.x program file |
| 0 | long | 0x2bba1919 | dL4 2.x program file |
| 0 | long | 0x1919ba30 | dL4 3.x program file |
| 0 | long | 0x30ba1919 | dL4 3.x program file |
The above lines will have to be modified on some Unix systems due to differences in the magic file format. On some systems, such as Linux, the magic file will reside in /usr/share or /usr/share/file and the command "file -C -m /usr/share/magic" must be executed before the file command will use the new definitions. If the "file -C" command produces a magic.mgc file in the local directory, then that file should be copied over the existing magic.mgc file in /usr/share or /usr/share/file.
- FAQ:
