static private CopyStream ( Stream fromStream, Stream toStream ) : int | ||
fromStream | Stream | The input stream. |
toStream | Stream | The output stream. |
return | int |
/// <summary> /// Copies 'sourceFilePath from the textStream system to the archive as /// 'targetArchivePath'. Will overwrite any existing textStream. /// </summary> /// <param name="sourceFilePath">The source filename.</param> /// <param name="targetArchivePath">The target path.</param> public void CopyFromFile(string sourceFilePath, string targetArchivePath) { using (Stream inFile = new FileStream(sourceFilePath, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.ReadWrite)) { using (Stream outFile = Create(targetArchivePath)) { ZipArchiveFile.CopyStream(inFile, outFile); } } this[targetArchivePath].LastWriteTime = File.GetLastWriteTime(sourceFilePath); }