public override void ReadMetadataEntry() { _archiveEntry.Dev = _entry.c_dev.ToString(); _archiveEntry.INode = _entry.c_ino.ToString(); // Type, Permission long mode = _entry.c_mode; _archiveEntry.ArchiveType = InternalWriteArchiveEntry.GetArchiveEntryType(mode); _archiveEntry.Permission = InternalWriteArchiveEntry.GetPermission(mode); _archiveEntry.Uid = _entry.c_uid; _archiveEntry.Gid = _entry.c_gid; unsafe { fixed(ushort *pointer = _entry.c_mtime) { byte[] array = GetByteArrayFromFixedArray(pointer, 2); _archiveEntry.mTime = ((long)BitConverter.ToInt32(array, 0)).ToUnixTime(); } } _archiveEntry.nLink = _entry.c_nlink; // rDev _archiveEntry.rDev = _entry.c_rdev; _archiveEntry.ExtractFlags = _extractFlags; }
public override void ReadMetadataEntry() { unsafe { byte[] majorBuffer; // Dev fixed(byte *pointer = _entry.c_dev) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } _archiveEntry.Dev = GetValueFromOctalValue(majorBuffer).ToString(); // Ino fixed(byte *pointer = _entry.c_ino) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } _archiveEntry.INode = GetValueFromOctalValue(majorBuffer).ToString(); // Type, Permission fixed(byte *pointer = _entry.c_mode) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } long mode = (long)GetValueFromOctalValue(majorBuffer); _archiveEntry.ArchiveType = InternalWriteArchiveEntry.GetArchiveEntryType(mode); _archiveEntry.Permission = InternalWriteArchiveEntry.GetPermission(mode); // Uid fixed(byte *pointer = _entry.c_uid) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } _archiveEntry.Uid = (int)GetValueFromOctalValue(majorBuffer); // Gid fixed(byte *pointer = _entry.c_gid) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } _archiveEntry.Gid = (int)GetValueFromOctalValue(majorBuffer); // mTime fixed(byte *pointer = _entry.c_mtime) { majorBuffer = GetByteArrayFromFixedArray(pointer, 11); } _archiveEntry.mTime = ((long)(GetValueFromOctalValue(majorBuffer))).ToUnixTime(); // nLink fixed(byte *pointer = _entry.c_nlink) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } _archiveEntry.nLink = (long)GetValueFromOctalValue(majorBuffer); // rDev fixed(byte *pointer = _entry.c_rdev) { majorBuffer = GetByteArrayFromFixedArray(pointer, 6); } _archiveEntry.rDev = (int)GetValueFromOctalValue(majorBuffer); _archiveEntry.ExtractFlags = _extractFlags; } }