예제 #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)
 {
     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
     };
     OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize);
 }
예제 #3
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);
        }
예제 #4
0
        protected override void WriteHeader(string name, DateTime lastModificationTime, long count, int userId, int groupId, int mode)
        {
            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
            };

            OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize);
        }
예제 #5
0
 /// <summary>
 /// Constructs TarReader object to read data from `tarredData` stream
 /// </summary>
 /// <param name="tarredData">A stream to read tar archive from</param>
 public TarReader(Stream tarredData)
 {
     inStream = tarredData;
     header = new UsTarHeader();
 }
예제 #6
0
 /// <summary>
 /// Constructs TarReader object to read data from `tarredData` stream
 /// </summary>
 /// <param name="tarredData">A stream to read tar archive from</param>
 public TarReader(Stream tarredData)
 {
     inStream = tarredData;
     header   = new UsTarHeader();
 }