我試圖避免必須包括其他庫,並保持這個簡單的OSX,使用自Snow Leopard自OSX附帶的默認Perl。我也試圖避免炮轟到Bash來運行解壓縮。我發現幾乎this example作品,但在這條線模具:從OSX上的默認Perl,如何解壓到文件夾?
my $fh = IO::File->new($destfile, "w") or die "Couldn't write to $destfile: $!";
與此錯誤:
Couldn't write to /tmp/mytest/Install Norton Security.localized//: Is a directory at test7.pl line 42.
以前,我拉上文件夾「安裝Norton Security.localized」到mytest.zip,把它貼in/tmp。然後我創建了一個目錄/ tmp/mytest。然後,我跑這個腳本
unzip("/tmp/mytest/mytest.zip","/tmp/mytest");
我也沒有對劇本棉絨語法檢查和它回來好嗎 - 沒有提醒我關於失蹤庫類似於Perl許多其它zip庫。
你有什麼建議是修復?