【问题标题】:Linux can't determine MIME type for 3GP, 3GPP2, etc. files?Linux 无法确定 3GP、3GPP2 等文件的 MIME 类型?
【发布时间】:2011-11-14 05:25:43
【问题描述】:

当我跑步时

    file -bi 'filename'

在 CentOS 中对于 3GP、3GPP2 等文件,返回值为空。对于 JPEG、GIF、MPEG 等其他文件,该命令返回正确的 MIME 类型。为什么会这样?

谢谢!

【问题讨论】:

标签: linux centos mime 3gp


【解决方案1】:

因为这些视频文件类型的幻数没有定义

你可以看看

人文件

http://linux.die.net/man/1/file

【讨论】:

  • @tundoopani 在给定的手册页中:The environment variable MAGIC can be used to set the default magic number file name. If that variable is set, then file will not attempt to open $HOME/.magic . file adds ".mime" and/or ".mgc" to the value of this variable as appropriate. 所以设置$MAGIC 或创建一个$HOME/.magic 文件。
  • @glglgl 哇,这似乎完全是一个研究项目 - 添加幻数支持不是微不足道的!
  • 此外,似乎为各种视频格式定义了 幻数,包括我尝试识别的格式,但它仍然无法识别他们!
猜你喜欢
  • 2016-05-23
  • 2012-09-10
  • 2013-04-21
  • 2011-05-26
  • 2023-03-06
  • 1970-01-01
  • 2012-07-26
  • 2012-02-02
相关资源
最近更新 更多