Attributes Property

DotNetZip

Ionic Zip Library v1.9.1.6 Attributes Property
ReferenceIonic.ZipZipEntryAttributes
The file attributes for the entry.
Declaration Syntax
C# Visual Basic Visual C++
public FileAttributes Attributes { get; set; }
Public Property Attributes As FileAttributes
	Get
	Set
public:
property FileAttributes Attributes {
	FileAttributes get ();
	void set (FileAttributes value);
}
Remarks

The attributes in NTFS include ReadOnly, Archive, Hidden, System, and Indexed. When adding a ZipEntry to a ZipFile, these attributes are set implicitly when adding an entry from the filesystem. When adding an entry from a stream or string, the Attributes are not set implicitly. Regardless of the way an entry was added to a ZipFile, you can set the attributes explicitly if you like.

When reading a ZipEntry from a ZipFile, the attributes are set according to the data stored in the ZipFile. If you extract the entry from the archive to a filesystem file, DotNetZip will set the attributes on the resulting file accordingly.

The attributes can be set explicitly by the application. For example the application may wish to set the FileAttributes.ReadOnly bit for all entries added to an archive, so that on unpack, this attribute will be set on the extracted file. Any changes you make to this property are made permanent only when you call a Save() method on the ZipFile instance that contains the ZipEntry.

For example, an application may wish to zip up a directory and set the ReadOnly bit on every file in the archive, so that upon later extraction, the resulting files will be marked as ReadOnly. Not every extraction tool respects these attributes, but if you unpack with DotNetZip, as for example in a self-extracting archive, then the attributes will be set as they are stored in the ZipFile.

These attributes may not be interesting or useful if the resulting archive is extracted on a non-Windows platform. How these attributes get used upon extraction depends on the platform and tool used.

This property is only partially supported in the Silverlight version of the library: applications can read attributes on entries within ZipFiles. But extracting entries within Silverlight will not set the attributes on the extracted files.

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)