Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 699

Determine if file is a directory, inside zip archive

$
0
0

I read zip files according to the specification, and get information for each file, from a central directory. From the headers I read:

#define VERSION_NEEDED_OFSSET 6UINT16 versionNeeded = (UINT16)*(zipFile + VERSION_NEEDED_OFSSET);

So I zipped some files, and also a few directories, and when I got info about the directory, I got versionNeeded = 0x000a

From the documentation I read:

The minimum supported ZIP specification version needed to extract the file, mapped as above. This value is based on the specific format features a ZIP program MUST support to be able to extract the file. If multiple features are applied to a file, the minimum version MUST be set to the feature having the highest value. New features or feature changes affecting the published format specification will be implemented using higher version numbers than the last published value to avoid conflict.

4.4.3.2 Current minimum feature versions are as defined below:

1.0 - Default value

1.1 - File is a volume label

2.0 - File is a folder (directory)

But what is the part of the zip header that is used to determine the file type? I cannot see any types or bits that are responsible for the file type from the documentation.


Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>