public void WriteDirectoryEntry(string path, string username, string groupname, int mode, DateTime lastModificationTime) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException("path"); } if (path[path.Length - 1] != '/') { path += '/'; } var tarHeader = new UsTarHeader() { FileName = path, LastModification = lastModificationTime, SizeInBytes = 0, UserId = username.GetHashCode(), UserName = username, GroupId = groupname.GetHashCode(), GroupName = groupname, Mode = mode, EntryType = tar_cs.EntryType.Directory, }; OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize); }
public void WriteDirectoryEntry(string path, string username, string groupname, int mode, DateTime lastModificationTime) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException("path"); } if (path[path.Length - 1] != '/') { path += '/'; } var tarHeader = new UsTarHeader() { FileName = path, LastModification = lastModificationTime, SizeInBytes = 0, UserId = username.GetHashCode(), UserName = username, GroupId = groupname.GetHashCode(), GroupName = groupname, Mode = mode, EntryType = tar_cs.EntryType.Directory, }; OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize); }
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); }
protected virtual void WriteHeader(string name, DateTime lastModificationTime, long count, string userName, string groupName, int mode) { UsTarHeader usTarHeader1 = new UsTarHeader(); usTarHeader1.FileName = name; usTarHeader1.LastModification = lastModificationTime; usTarHeader1.SizeInBytes = count; usTarHeader1.UserId = userName.GetHashCode(); usTarHeader1.UserName = userName; usTarHeader1.GroupId = groupName.GetHashCode(); usTarHeader1.GroupName = groupName; usTarHeader1.Mode = mode; UsTarHeader usTarHeader2 = usTarHeader1; this.OutStream.Write(usTarHeader2.GetHeaderValue(), 0, usTarHeader2.HeaderSize); }
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); }
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); }
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); }
protected override void WriteHeader(string name, DateTime lastModificationTime, long count, int userId, int groupId, int mode, EntryType entryType) { UsTarHeader usTarHeader1 = new UsTarHeader(); usTarHeader1.FileName = name; usTarHeader1.LastModification = lastModificationTime; usTarHeader1.SizeInBytes = count; usTarHeader1.UserId = userId; usTarHeader1.UserName = Convert.ToString(userId, 8); usTarHeader1.GroupId = groupId; usTarHeader1.GroupName = Convert.ToString(groupId, 8); usTarHeader1.Mode = mode; usTarHeader1.EntryType = entryType; UsTarHeader usTarHeader2 = usTarHeader1; this.OutStream.Write(usTarHeader2.GetHeaderValue(), 0, usTarHeader2.HeaderSize); }
private void WriteHardLink(string name, DateTime lastModificationTime, string linkName, string userName, string groupName, int mode) { var tarHeader = new UsTarHeader() { FileName = name, LastModification = lastModificationTime, SizeInBytes = 0, UserId = userName.GetHashCode(), UserName = userName, GroupId = groupName.GetHashCode(), GroupName = groupName, Mode = mode, EntryType = tar_cs.EntryType.HardLink, LinkName = linkName, }; OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize); }
protected override async Task WriteHeaderAsync(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 }; await OutStream.WriteAsync(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize); }
private void WriteHardLink(string name, DateTime lastModificationTime, string linkName, string userName, string groupName, int mode) { var tarHeader = new UsTarHeader() { FileName = name, LastModification = lastModificationTime, SizeInBytes = 0, UserId = userName.GetHashCode(), UserName = userName, GroupId = groupName.GetHashCode(), GroupName = groupName, Mode = mode, EntryType = tar_cs.EntryType.HardLink, LinkName = linkName, }; OutStream.Write(tarHeader.GetHeaderValue(), 0, tarHeader.HeaderSize); }
public void WriteHeader(UsTarHeader header) { _headerPosition = OutStream.Position; OutStream.Write(header.GetHeaderValue(), 0, header.HeaderSize); }
protected virtual void WriteHeader(string name, DateTime lastModificationTime, long count, string userName, string groupName, int mode) { var tarHeader = new UsTarHeader(name, mode, count, lastModificationTime); var header = tarHeader.GetHeaderValue(); OutStream.Write(header, 0, header.Length); }