暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

create-mime.assign.pl 461B

1234567891011121314151617181920
  1. #!/usr/bin/perl -w
  2. use strict;
  3. open MIMETYPES, "/etc/mime.types" or exit;
  4. print "mimetype.assign = (\n";
  5. my %extensions;
  6. while(<MIMETYPES>) {
  7. chomp;
  8. s/\#.*//;
  9. next if /^\w*$/;
  10. if(/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/) {
  11. foreach(split / /, $2) {
  12. # mime.types can have same extension for different
  13. # mime types
  14. next if $extensions{$_};
  15. $extensions{$_} = 1;
  16. print "\".$_\" => \"$1\",\n";
  17. }
  18. }
  19. }
  20. print ")\n";