dk packages /

CommonsBase_FileMagic 0.1.20260711004745

Source →

Usage

OpenBSD file(1)

The file utility tests each argument and attempts to determine its type. Three sets of tests are performed:

1. Filesystem tests, for example if a file is empty, or a special file such as a socket or named pipe (FIFO).
2. “Magic” tests for data in particular fixed formats. These are loaded from the /etc/magic file (or ~/.magic instead if it exists and file is not running as root). The file format is described in magic(5).
3. Tests for text files such as plain ASCII or C programming language files.

The first test which succeeds causes the file type to be printed. The type will often contain one of the words text (contains only printing characters and is probably safe to read on an ASCII terminal), executable (the file contains a compiled executable program) or data meaning anything else.

The object is bin/file.exe compiled for the ABI.

  $ get-object CommonsBase_FileMagic.File@7.8.50407 -s Release.target_abi -d ${RUNTIME}/File-7.8.50407
  \test(pass)
  \dk.object(abi: "Release.Darwin_arm64", value-id: "orw5ufcbtpfhoolmn3edctuks5slcu6mpsekz4ju5iv2zviwpspjq")
  \dk.object(abi: "Release.Darwin_x86_64", value-id: "ojnr3jm3fxbo5xj3nkita2kbymekuj2zjmmsdncpupwvvk6wdizsa")
  \dk.object(abi: "Release.Linux_arm64", value-id: "o5avhm2mcs3q527pe3vv5yownl2orfxu7ak3bpy7kvjve5iwpr6gq")
  \dk.object(abi: "Release.Linux_x86", value-id: "oszw7iqompkbdpr46nmd2mtefnnej4bdwqezpzpalqvgr232jyizq")
  \dk.object(abi: "Release.Linux_x86_64", value-id: "oye5vhgtd74nhaml2opt5nxz67oypdq3g34rjtpe4tmhnhncqbjwa")
  \dk.object(abi: "Release.Windows_arm64", value-id: "ov4aynftw2g2st7xt3qvoxtmjgc7gndpytgdixr4srctzx75izkmq")
  \dk.object(abi: "Release.Windows_x86", value-id: "ogfs7l4ljjrzdomjs6dgmgfal4mrzeo4tbeyrdjaitb6bxd2v5vza")
  \dk.object(abi: "Release.Windows_x86_64", value-id: "oteegaquqsej3mxqqnnanbgg7mocda64itjjdcq4tswv4jrr5oaiq")\;

Running bin/file.exe on itself (the bin/file.exe) will tell us what CPU architecture and operating system
the executable was compiled for.

  $ run-object CommonsBase_FileMagic.File@7.8.50407 -s Release.execution_abi -m ./bin/file.exe -e bin/file.exe --
  >   -b $(get-object CommonsBase_FileMagic.File@7.8.50407 -s Release.target_abi -d : -e file.exe)/bin/file.exe
  \test(pass)
  \dk.target(abi: "Darwin_arm64")[Mach-O 64-bit executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>
  ]
  \dk.target(abi: "Darwin_x86_64")[Mach-O 64-bit executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>
  ]
  \dk.target(abi: "Linux_arm64")[ELF 64-bit LSB executable, aarch64, version 1
  ]
  \dk.target(abi: "Linux_x86")[ELF 32-bit LSB executable, Intel i386, version 1 (SYSV)
  ]
  \dk.target(abi: "Linux_x86_64")[ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux)
  ]
  \dk.target(abi: "Windows_arm64")[PE32+ executable for MS Windows 6.00 (console),, 13 sections
  ]
  \dk.target(abi: "Windows_x86")[PE32 executable for MS Windows 6.00 (console),, 15 sections
  ]
  \dk.target(abi: "Windows_x86_64")[PE32+ executable for MS Windows 6.00 (console),, 14 sections
  ]\;

Provides

ModuleVersionPlatformvalue-id
CommonsBase_FileMagic.File 7.8.50407 Darwin_arm64 orw5ufcbtpfh…
CommonsBase_FileMagic.File 7.8.50407 Darwin_x86_64 ojnr3jm3fxbo…
CommonsBase_FileMagic.File 7.8.50407 Linux_arm64 o5avhm2mcs3q…
CommonsBase_FileMagic.File 7.8.50407 Linux_x86 oszw7iqompkb…
CommonsBase_FileMagic.File 7.8.50407 Linux_x86_64 oye5vhgtd74n…
CommonsBase_FileMagic.File 7.8.50407 Windows_arm64 ov4aynftw2g2…
CommonsBase_FileMagic.File 7.8.50407 Windows_x86 ogfs7l4ljjrz…
CommonsBase_FileMagic.File 7.8.50407 Windows_x86_64 oteegaquqsej…

Workspace assets

Files and directories in the package repo, bundled into the build.

AssetProject pathType
CompatHeader assets/compat/include/filemagic_compat.h file
CompatErr assets/compat/include/err.h file
CompatRegex assets/compat/include/regex.h file
CompatCdefs assets/compat/include/sys/cdefs.h file
CompatQueue assets/compat/include/sys/queue.h file
CompatTree assets/compat/include/sys/tree.h file
CompatNull assets/compat/include/sys/_null.h file
CompatVisHeader assets/compat/include/vis.h file
CompatSource assets/compat/src/filemagic_compat.c file
CompatRegexSource assets/compat/src/regex_compat.cpp file
CompatVisSource assets/compat/src/vis.c file
PortableMain assets/src/filemagic_portable_main.c file
PortableXmalloc assets/src/filemagic_portable_xmalloc.c file
MagicHeader assets/src/filemagic_magic.h file
MagicTestSource assets/src/filemagic_magic_test.c file
EmbeddedMagicHeader assets/src/filemagic_embedded_magic.h file
EmbeddedMagicSource assets/src/filemagic_embedded_magic.c file

Downloaded assets

Third-party sources fetched and checksum-verified during the build.

AssetSizesha256Source
src.tar.gz 212.5 MB 1f20cc61f3b5bc9b… https://ftp.OpenBSD.org/pub/OpenBSD/7.8/src.tar.gzhttps://mirror.aarnet.edu.au/pub/OpenBSD/7.8/src.tar.gzhttps://ftp.fr.openbsd.org/pub/OpenBSD/7.8/src.tar.gzhttps://ftp.fau.de/pub/OpenBSD/7.8/src.tar.gzhttps://ftp.jaist.ac.jp/pub/OpenBSD/7.8/src.tar.gzhttps://mirror.freedif.org/pub/OpenBSD/7.8/src.tar.gzhttps://ftp.nluug.nl/pub/OpenBSD/7.8/src.tar.gzhttps://mirror.ox.ac.uk/pub/OpenBSD/7.8/src.tar.gzhttps://mirrors.ocf.berkeley.edu/pub/OpenBSD/7.8/src.tar.gzhttps://openbsd.c3sl.ufpr.br/pub/OpenBSD/7.8/src.tar.gz

Dependencies

PackageVersionsha256
CommonsBase_LLVM 0.1.20260706064049 8f32bfb59d849ce6…
CommonsBase_Remote 0.1.20260711004226 64096f4246e3a0fd…