Class: Zip::ZipExtraField::IUnix

### Home Classes Methods

### In Files

- lib/zip/zip_extra_field.rb

### Parent

Zip::ZipExtraField::Generic

### Methods

- ::new
- #==
- #merge
- #pack_for_c_dir
- #pack_for_local

### Class/Module Index

Quicksearch

- Zip
- Zip::ZipCentralDirectory
- Zip::ZipCompressionMethodError
- Zip::ZipDestinationFileExistsError
- Zip::ZipEntry
- Zip::ZipEntryExistsError
- Zip::ZipEntryNameError
- Zip::ZipError
- Zip::ZipExtraField
- Zip::ZipExtraField::Generic
- Zip::ZipExtraField::IUnix
- Zip::ZipExtraField::UniversalTime
- Zip::ZipFile
- Zip::ZipFileSystem
- Zip::ZipFileSystem::ZipFsDir
- Zip::ZipFileSystem::ZipFsFile
- Zip::ZipFileSystem::ZipFsFile::ZipFsStat
- Zip::ZipInputStream
- Zip::ZipInternalError
- Zip::ZipOutputStream
- Zip::ZipStreamableDirectory
- Zip::ZipStreamableStream
- IOExtras
- IOExtras::AbstractInputStream
- IOExtras::AbstractOutputStream
- IOExtras::FakeIO
- BugFix
- Object

No matching classes.

# Zip::ZipExtraField::IUnix

Info-ZIP Extra for UNIX uid/gid

### Constants

HEADER_ID

### Attributes

gid[RW]
uid[RW]

### Public Class Methods

new(binstr = nil) click to toggle source

    # File lib/zip/zip_extra_field.rb, line 98
    def initialize(binstr = nil)
      @uid = 0
      @gid = 0
      binstr and merge(binstr)
    end

### Public Instance Methods

==(other) click to toggle source

    # File lib/zip/zip_extra_field.rb, line 115
    def ==(other)
      @uid == other.uid &&
      @gid == other.gid
    end

merge(binstr) click to toggle source

    # File lib/zip/zip_extra_field.rb, line 105
    def merge(binstr)
      return if binstr.empty?
      size, content = initial_parse(binstr)
      # size: 0 for central directory. 4 for local header
      return if(!size || size == 0)
      uid, gid = content.unpack("vv")
      @uid ||= uid
      @gid ||= gid
    end

pack_for_c_dir() click to toggle source

    # File lib/zip/zip_extra_field.rb, line 124
    def pack_for_c_dir
      ""
    end

pack_for_local() click to toggle source

    # File lib/zip/zip_extra_field.rb, line 120
    def pack_for_local
      [@uid, @gid].pack("vv")
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.