Search notes:

Perl module File::Type

#!/usr/bin/perl
use warnings;
use strict;

use File::Type;

use File::Spec;
use Cwd;

my $ft = File::Type->new;

# Hmmm... Why does the .txt return «application/octet-stream»?
print $ft -> mime_type ($0                                            ), "\n"; # application/x-perl
print $ft -> mime_type (File::Spec->canonpath(cwd . '../../README.md')), "\n"; # application/octet-stream
print $ft -> mime_type (File::Spec->canonpath(cwd . '/file.txt'      )), "\n"; # application/octet-stream
Github repository PerlModules, path: /File/Type/script.pl

See also

Perl module File::LibMagic
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741107633, '18.191.255.180', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/File/Type/index(55): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78