[File] [PATCH] Magdir/algol68 xBase program *.prg misidentified as Algol 68 source
Christos Zoulas
christos at zoulas.com
Sun Aug 15 06:03:07 UTC 2021
On Aug 13, 12:17am, joerg.jen.der.ek at gmx.net (=?UTF-8?Q?J=c3=b6rg_Jenderek?=) wrote:
-- Subject: [File] [PATCH] Magdir/algol68 xBase program *.prg misidentified a
Committed, thanks!
christos
| Hello,
|
| some days ago i inspected some dBase examples. Now i looked at xBase
| program scripts with PRG file name extension.
|
| When running running file command version 5.40 on such examples and
| related files i get an output like:
|
| general.a68: ASCII text, with CRLF line terminators
| graph_2d.a68: ASCII text, with CRLF line terminators
| is_prime.a68: Algol 68 source, ASCII text, with CRLF line terminators
| pow_mod.a68: Algol 68 source, ASCII text, with CRLF line terminators
| sort.a68: Algol 68 source, ASCII text, with CRLF line terminators
| AREACODE.PRG: Algol 68 source, ASCII text, with CRLF line terminators
| BARCOUNT.PRG: Algol 68 source, ASCII text, with CRLF line terminators
| MENUS.PRG: Algol 68 source, ASCII text, with CRLF line terminators
| VENDORS.PRG: Algol 68 source, ASCII text, with CRLF line terminators
|
| For the examples a page about ALGOL 68 programming language on
| Wikipedia was found. More information can be found in the revised
| Report on the Algorithmic Language Algol 68. So this information is
| now expressed by additional comment lines inside Magdir/algol68 like:
| # URL: https://en.wikipedia.org/wiki/ALGOL_68
| # Reference: http://www.softwarepreservation.org/projects/ALGOL/
| # report/Algol68_revised_report-AB.pdf
|
| The detection of my examples happens by lines inside Magdir/algol68 like:
| 0 search/8192 (input, Algol 68 source text
| !:mime text/x-Algol68
| 0 regex/1024 \^PROC Algol 68 source text
| !:mime text/x-Algol68
|
| By these lines the program look for specific keyword or language
| constructs at the beginning and then display describing text "Algol
| 68 source text". Unfortunately this is sometimes not unique enough.
|
| So i embed displaying part inside sub routine like:
| 0 name algol_68 Algol 68 source text
| !:mime text/x-Algol68
| !:ext a68
| Now also file name extension "a68" is shown. Maybe also file name
| extension "alg" is used.
|
| Now the first construct becomes like:
| 0 search/8192 (input,
| >0 use algol_68
|
| Some Algol 68 source examples like general.a68 and graph_2d.a68 are
| only described as "ASCII text" because the search range is too small.
| Furthermore second construct is also true for many dBase program
| scripts (*.PRG) with keyword PROCEDURE with names (like: Areacode
| BarCount Def_mens Vendors). On the other hand this also is true for
| proc keyword probably followed by white space used to specify algol
| procedures.
|
| So the second construct now becomes like:
| 0 regex/4006 \^PROC
| #>&-4 string =3DPROCEDURE \b, dBase PROCEDURE
| >&-4 string !PROCEDURE
| >>0 use algol_68
|
| After applying the above mentioned modifications by patch
| file-5.40-algol68-a68.diff then more Algol 68 sources are now
| recognized and misidentification of xBase program scripts *.prg
| vanish like:
|
| general.a68: Algol 68 source, ASCII text, with CRLF line terminators
| graph_2d.a68: Algol 68 source, ASCII text, with CRLF line terminators
| is_prime.a68: Algol 68 source, ASCII text, with CRLF line terminators
| pow_mod.a68: Algol 68 source, ASCII text, with CRLF line terminators
| sort.a68: Algol 68 source, ASCII text, with CRLF line terminators
| AREACODE.PRG: ASCII text, with CRLF line terminators
| BARCOUNT.PRG: ASCII text, with CRLF line terminators
| MENUS.PRG: ASCII text, with CRLF line terminators
| VENDORS.PRG: ASCII text, with CRLF line terminators
|
| I hope my diff file can be applied in future version of file utility.
|
| With best wishes
| J=C3=B6rg Jenderek
| =2D-
| J=C3=B6rg Jenderek
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| --------------254AA9F70CD6D268BDA4AF78
| Content-Type: application/DEFANGED-938; charset="UTF-8"; name="file-5_40-algol68-a68_diff.DEFANGED-938"
| Content-Transfer-Encoding: base64
| Content-Disposition: attachment; filename="file-5_40-algol68-a68_diff.DEFANGED-938"
|
| LS0tIGZpbGUtNS40MC9tYWdpYy9NYWdkaXIvYWxnb2w2OC5vbGQJMjAyMS0wMi0yMiAyMzo0
| OToyNCArMDAwMAorKysgZmlsZS01LjQwL21hZ2ljL01hZ2Rpci9hbGdvbDY4CTIwMjEtMDgt
| MTIgMjE6NTk6M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RleHQKKyM+MAl1c2UJCWFs
| Z29sXzY4CiAjITptaW1lCXRleHQveC1BbGdvbDY4Cg==
|
| --------------254AA9F70CD6D268BDA4AF78
| Content-Type: application/DEFANGED-939; name="file-5_40-algol68-a68_diff_sig.DEFANGED-939"
| Content-Transfer-Encoding: base64
| Content-Disposition: attachment; filename="file-5_40-algol68-a68_diff_sig.DEFANGED-939"
|
| owGtVc+LI0UUjuO6UAHBFVxkWeHNxpFlk/6R3mTMNDhMZiajLrOMBHZZ2Kyh0v06KdPpaqoq
| 08lJ8KS3BQ8e/AEiXgQRvYgnBUEYYT2pt2XZP0AE/wCxutMThzGjwmwfmn6v3ve9r96rV333
| yccLS+e++OPLg80LP//62OdnD3oXAhaiUTdrtkHDPg9XGwZdbZg+CwL6zAfvGoYB8whrRPvM
| s67Tvs+ElYebPPSJYztVw3YMxwHnqltbc50alG39FMvl8n8Q5OCGUdXgqltfc6++mIM3NsCo
| V6p1KNcr2rmxUYRS0bCJRCq8gdWorjnkMovisaoQQpopH6w2QPKx8BAUTlTRWHZHbIQkNayJ
| 0ZzlTEkE9nFiVW2nRjqvv9be2zodRe/63nbrdkd14M7peNqtnUdBs7PbujXj6VzpdG4v5iqX
| 4EZ71wVCBkrF0rUsjMyEDVmMPqMmF30rtazm7st7u12dRQPaGKDAyEM3A2lMkiSm5IFKqMBY
| oESxTxXjUYaPBX8DPSVnHJaO4EJZuequwH0m0e/O3EZz04z9IJMV+1TpFNc4ij5cw8jXSYfF
| 8sLmF8vrNhlLJCQ7U7nQvqDxoOv4Jk3tw/LUbHs1b7gOWn/BqBGpBIv6hEz0Cej0KuBvUonA
| BcxqdmlFXkr5RlwqmGRr0hMsVhKumLFWlzA1gJSwtX2j3YKQDdGFpkDqcR9hk4otPo4UbGPQ
| HWEk4abeDRfyePqX5hRHZcydqQSpO5NL0HXVGxz9u5QhThMu/BSaf6Y4L331aC+cQsDDkCfo
| Q28KyYApvbWY6tOhi+mD4tpCjwVTyOqaYdEf6xbrih+VvnxE5fo/e3HipCxq3GmC57PzP2KP
| DcgiRFo3n8k4pFNgUcDFKDvXWYchHUJQ0xiBRn52x0FEtUvPlW5yGsYDWDx1Nkkj/850wqTD
| 4knXog6nNbtZ5wnNCJUlEYcospXufKWbjcCyqx0AkBmlI1Z6FevdQikvEcwfMqvQ3vYJEvUR
| Pl41KC2WfTL7zqunZ3/7zpnCuaXCc+eXz3zz5yc3L68XXvHeefbbw3/dE0vp36xQJE8dehqf
| Fj56/q337n/38OOVr/fv/f7mgx+70/e/HxQ+vPjT3cpv974Ktw7O91q3Vn54+sEvn/0F
|
| --------------254AA9F70CD6D268BDA4AF78
| Content-Type: text/plain; charset="us-ascii"
| MIME-Version: 1.0
| Content-Transfer-Encoding: 7bit
| Content-Disposition: inline
|
| --
| File mailing list
| File at astron.com
| https://mailman.astron.com/mailman/listinfo/file
|
| --------------254AA9F70CD6D268BDA4AF78
| Content-Type: text/sanitizer-log; charset="iso-8859-1"
| Content-Transfer-Encoding: 8bit
| Content-Disposition: attachment; filename="sanitizer.log"
|
| This message has been 'sanitized'. This means that potentially
| dangerous content has been rewritten or removed. The following
| log describes which actions were taken.
|
| Sanitizer (start="1628806664"):
| Part (pos="4566"):
| SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
| Match (names="unnamed.txt", rule="9"):
| Enforced policy: accept
|
| Part (pos="8175"):
| SanitizeFile (filename="file-5.40-algol68-a68.diff", mimetype="text/plain"):
| Match (rule="default"):
| Enforced policy: defang
|
| Replaced mime type with: application/DEFANGED-938
| Replaced file name with: file-5_40-algol68-a68_diff.DEFANGED-938
|
| Part (pos="10705"):
| SanitizeFile (filename="file-5.40-algol68-a68.diff.sig", mimetype="application/octet-stream"):
| Match (rule="default"):
| Enforced policy: defang
|
| Replaced mime type with: application/DEFANGED-939
| Replaced file name with: file-5_40-algol68-a68_diff_sig.DEFANGED-939
|
| Part (pos="12098"):
| SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
| Match (names="unnamed.txt", rule="9"):
| Enforced policy: accept
|
| Total modifications so far: 2
|
|
| Anomy 0.0.0 : Sanitizer.pm
| $Id: Sanitizer.pm,v 1.94 2006/01/02 16:43:10 bre Exp $
|
| --------------254AA9F70CD6D268BDA4AF78--
-- End of excerpt from =?UTF-8?Q?J=c3=b6rg_Jenderek?=
More information about the File
mailing list