Пример #1
0
        protected virtual void WriteHeader(string name, DateTime lastModificationTime, long count, string userName, string groupName, int mode)
        {
            var tarHeader = new UsTarHeader()
            {
                FileName         = name,
                LastModification = lastModificationTime,
                SizeInBytes      = count,
                UserId           = userName.GetHashCode(),
                UserName         = userName,
                GroupId          = groupName.GetHashCode(),
                GroupName        = groupName,
                Mode             = mode
            };

            OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize);
        }
Пример #2
0
        protected override void WriteHeader(string name, DateTime lastModificationTime, long count, int userId, int groupId, int mode, EntryType entryType)
        {
            var tarHeader = new UsTarHeader()
            {
                FileName         = name,
                LastModification = lastModificationTime,
                SizeInBytes      = count,
                UserId           = userId,
                UserName         = Convert.ToString(userId, 8),
                GroupId          = groupId,
                GroupName        = Convert.ToString(groupId, 8),
                Mode             = mode,
                EntryType        = entryType
            };

            OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize);
        }