如果文件名没有后缀,我想知道如何知道文件类型。
例如,命名的文件myfile可以是二进制或文本开头,系统如何知道文件是二进制还是文本?
myfile
filesystems mime-types files file-opening
在 Windows 中,我们可以将文件的扩展名与程序相关联。 例如,由于扩展名,文件test.pl可以由安装的Perl解释器运行pl。 在 linux 中,虽然它需要#!/usr/bin/perl作为第一行。 这是因为在 Linux 中文件扩展名和程序之间没有关联吗?
test.pl
Perl
pl
#!/usr/bin/perl
executable filenames file-opening
file-opening ×2
executable ×1
filenames ×1
files ×1
filesystems ×1
mime-types ×1