Skip to content

Instantly share code, notes, and snippets.

@vivithemage
vivithemage / libmagic_example.c
Last active October 18, 2022 21:24
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,