Unix: Impossible File Types

Given the plethora of file types showing up on file servers today, the very idea of an "impossible" file type is hard to grasp. What would make a file type impossible after all? Would it defy classification by the file system? Would it have a negative length? "Unknown file type" I could understand. Impossible takes an extra stretch of the imagination.

I came across dozens of these messages while examining the contents of a tar file with "tar tvf". The files inside the tar file were not particularly offensive. Most were Sparc executables (ELF 32-bit MSB executable SPARC32PLUS Version 1) or directories. Some of the "tar: impossible file type" messages showed up succession with no intervening TOC data on the files themselves, making it very hard to determine which of the files or directories tar was finding so incredulous.

tar: impossible file typetar: impossible file typetar: impossible file typetar: impossible
file typetar: impossible file typetar: impossible file typetar: impossible file typetar:
impossible file typetar: impossible file typetar: impossible file typetar: impossible file
typetar: impossible file typetar: impossible file type

After a bit of checking, it appears that errors such as these are associated with a bug in OpenSolaris -- a bug associated with long file names. While the tar command is supposed to handle file names as long as 100 characters, it seems that the command in some version of OpenSolaris balks or did balk if the length of filenames exceeded 98 characters. In my case, the longest filename was only 80 characters long and the OS was Solaris 9. And a "tar tvf" command on the very same tar file on Solaris 10 showed no signs of problems with file types or file name lengths.

Fortunately, the odd errors seem to have no more effect than to puzzle the sysadmin who is checking the contents of a tar file before extracting it. As the files were being extracted, no complaints about file types were issued and all files extracted properly.

The moral of the story is that you're never too old for an error you've never seen before and bugs exist even in some of the most well behaved operating systems. This one I'd never seen before and am still puzzling over.

Even if the files in my tar file somehow managed to become part of a tar file with names (paths and all) longer than 98 or 100 characters, "impossible file type" would be a very strange way to express the problem. With file names (including paths) of less than 80 characters, these errors are quite mysterious.

If you've seen this same behavior or have similar strange encounters with errors of the third kind, I'd love to hear from you.

Top 10 Hot Internet of Things Startups
Join the discussion
Be the first to comment on this article. Our Commenting Policies