我有一些可以用以下方式提取的文件tar
:
tar -tvf attachment.tar
但是当我用以下方式测试时,file
我得到了以下结果:
attachment.tar: uuencoded or xxencoded text, ASCII text, with CRLF line terminators
该文件的第一个字节begin 644 RST.0486.20220814-0300.tar
如下:
M0U4P-#@V+D%)6%-C86XN,C`R,C`X,30M,#,P,"YT>'0`````````````````
M````````````````````````````````````````````````````````````
M`````````````#$P,#8T-"``,#`P,#`P(``P,#`P,#`@`#`P,#`P,3(P-S4S
M(#$T,C<V,3$V-C0T(#`Q-34R,0`@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,')O;W0`
M````````````````````````````````````<WES=&5M````````````````
M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````**BHJ*BHJ*B`@1&%T92`@*BHJ*BHJ*BH*<WEM
该库也无法将其识别为 tar 文件:
https://github.com/imagekit-developer/imagekit-ios/wiki/MimeType
bytes[257...261] == [0x75, 0x73, 0x74, 0x61, 0x72]
我如何才能找到该档案的确切类型和格式?
答案1
您搜索的命令是
uudecode attachment.tar
这将转换 uuencoded tar 文件,其名称RST.0486.20220814-0300.tar
取自原始文件。
此格式的用途是仅通过 ASCII 格式的“媒体”二进制文件进行传输。
答案2
确切的类型和格式就是字面上file
的意思——它是一个 UUEncoded 文件。这种编码在 MIME/Base64 出现之前的早期网络上很常见(即在电子邮件有“附件”之前)。
UUEncode 只是一种传输格式,实际的 TAR 存档位于其中(类似于 GZip 中包含 TAR)。使用将uudecode
数据转换回二进制格式,然后然后您可能有一个常规的 TAR 档案。Linux 在“sharutils”包中有此程序,而对于 Windows,您可以使用 UUDeview 或 UUDWin32。
通常,邮件客户端应该自动解码传输编码,或者至少将文件保存为“attachment.tar.uu”(尽管我认为后者没有真正的惯例)。