Skip to content

Instantly share code, notes, and snippets.

@vivithemage
vivithemage / libmagic_example.c
Last active August 26, 2024 02:25
libmagic.h example
#include <stdio.h>
#include <magic.h>
int main(void)
{
char *actual_file = "/file/you/want.yay";
const char *magic_full;
magic_t magic_cookie;
/* MAGIC_MIME tells magic to return a mime of the file,