⚲
Project
General
Profile
Sign in
Register
Home
Projects
Donate
Help
Search
:
Lighttpd
All Projects
Lighttpd
Overview
Activity
Roadmap
Issues
News
Wiki
Forums
Repository
Blog
Developer Blog
Download (530 Bytes)
Bug #2280
» create-mime.assign.pl
00marcus
, 2010-12-18 17:31
#!/usr/bin/perl -w
use
strict
;
open
(
FILE
,
"
>>/tmp/a
");
print
FILE
"
iwashere
\n
"
;
close
(
FILE
);
open
MIMETYPES
,
"
/etc/mime.types
"
or
exit
;
print
"
mimetype.assign = (
\n
";
my
%extensions
;
while
(
<
MIMETYPES
>
)
{
chomp
;
s/\#.*//
;
next
if
/^\w*$/
;
if
(
/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/
)
{
foreach
(
split
/ /
,
$
2
)
{
# mime.types can have same extension for different
# mime types
next
if
$extensions
{
$_
};
$extensions
{
$_
}
=
1
;
print
"
\"
.
$_
\"
=>
\"
$1
\"
,
\n
";
}
}
}
print
"
)
\n
";
« Previous
1
…
3
4
5
Next »
(5-5/5)
Loading...