Git Product home page Git Product logo

pktoolbox's People

Contributors

pk avatar

Stargazers

 avatar

Watchers

 avatar

pktoolbox's Issues

PKZipUnarchiver does not create intermediate directories for files

The intermediate files are not created while unzipping files. If the ZIP file contains directories, everything works as expected. But if the ZIP utility has not added entries for the intermediate directories, unzipping fails.

usually common command line tools to create zip files omit adding
directory names to the zip file. They are not necessary because
non empty directories can be derived from the file paths.

Previous unzipping in PKZipUnarchiver failed to unzip files if
the directories are not present in the ZIP file. Thus zipping on
the command line under Windows/Linux/MacOS produced an
incompatible ZIP file, espacially if just some files are added
to the ZIP file for incremental updates instead of the whole
directory.

This fix forces the creation of directories prior to unzipping
the files.

Signed-off-by: nros [email protected]

PKToolbox/Sources/Foundation/PKZipUnarchiver.m | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/PKToolbox/Sources/Foundation/PKZipUnarchiver.m b/PKToolbox/Sources/Foundation/PKZipUnarchiver.m
index aa61991..9202d6a 100644
--- a/PKToolbox/Sources/Foundation/PKZipUnarchiver.m
+++ b/PKToolbox/Sources/Foundation/PKZipUnarchiver.m
@@ -76,6 +76,11 @@
attributes:nil
error:outError];
} else {

  •        [fileManager createDirectoryAtPath:[currentFilePath stringByDeletingLastPathComponent]
    
  •               withIntermediateDirectories:YES
    
  •                                attributes:nil
    
  •                                     error:outError];
    
    •    [fileManager createFileAtPath:currentFilePath
                              contents:nil
                            attributes:nil];
      
    -- 1.7.5.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.