【问题标题】:Save() never gets finishedSave() 永远不会完成
【发布时间】:2011-12-07 05:15:50
【问题描述】:

我尝试使用 DotNetZip 创建存档。 我可以使用 AddFile 方法并且可以保存和处理 zip 文件。

但是当我尝试仅使用 AddDirectory 添加文件夹时,以下保存并没有结束。

有人知道会出什么问题吗?如某些示例所示,我尝试附加 MaxOutPutSegmentSize 和 UseZip64WhenSaving,但这并没有改变任何东西。我尝试使用 explizit zip 文件调用 Save。

function ZipUp-Files ( $mychildren )
{
  foreach ($o in $mychildren) 
  {
        $e= $zipfile.AddDirectory($o.FullName,$o.fullname.substring($pwd.path.length));
  }
}

$children =get-childitem -recurse -force | where-object {$_.psiscontainer} | where {$_.name -match $teststring} 

[System.Reflection.Assembly]::LoadFrom("C:\dotNetZip\zip-v1.9\Release\Ionic.Zip.dll");
$zipfile =  new-object Ionic.Zip.ZipFile($ziptarget);
ZipUp-Files $children
$zipfile.Save()
$zipfile.Dispose()

提前致谢

【问题讨论】:

  • 您的文件夹中有什么?您是否尝试过只使用空文件夹? "Save doesn't come to end." 是什么意思?什么意思?

标签: powershell dotnetzip


【解决方案1】:

在这里我找到了一个解决方案,解决了我的问题:

http://dotnetzip.codeplex.com/discussions/276149

但我仍然不知道,最好和最快的解决方法是什么。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-29
    • 2018-05-11
    • 1970-01-01
    相关资源
    最近更新 更多