Can a zip file contain hidden files

zip

In Windows, a file can have an attribute marking it as hidden. In linux, a file's permissions can be set so that some users can not read/write the file (making it somewhat hidden to some users).

Can a zip file contain a "hidden" file in either windows or linux? Does the official zip file standard support "hidden" files? A reference to a definitive/official statement from the standard for zip files would be ideal.

Thanks.

Best Answer

Yes, the ZIP archive format holds both DOS, OS/2, and Windows NT file/directory attributes and POSIX permissions. Both go in the "external file attributes" field of the central directory record for a file.

And this is "official". It's documented in the file format specification and the tools supported it for years, storing attributes in archives and restoring them upon extraction (as told to). For example: PKWare's PKZIP version 2.5 for OS/2 and for DOS had a -attributes option that allowed one to choose whether to process files with the hidden, readonly, and system attributes.

It also stored OS/2 extended attributes.

Further reading

Related Question