Coder Social home page Coder Social logo

Comments (4)

ctabin avatar ctabin commented on August 25, 2024

Hi @aijyo,

In a ZIP file, all the entry paths are separated by a slash (/), even on windows. Hence, this macro should never be used to match "real" directory paths under windows. Maybe a better name would be "ENTRY_PATH_SEPARATOR".

And for your remark for a addDir API, the problem is the compatibility between linux and windows, because the file & folder API is platform dependant (or you need to include an API that provides a generic access, like Qt, but that would then be very heavy).

from libzippp.

aijyo avatar aijyo commented on August 25, 2024

Hi @aijyo,

In a ZIP file, all the entry paths are separated by a slash (/), even on windows. Hence, this macro should never be used to match "real" directory paths under windows. Maybe a better name would be "ENTRY_PATH_SEPARATOR".

And for your remark for a addDir API, the problem is the compatibility between linux and windows, because the file & folder API is platform dependant (or you need to include an API that provides a generic access, like Qt, but that would then be very heavy).

For the DIRECTORY_SEPARATOR problem , I normalized the path with the slash (/) (just like the nodejs.path.normalize...,but not the same) before call the libzipp api;

Add the addDir, I found a solution that seems not too heavy, I use dirent.h(https://github.com/tronkko/dirent), so I can enum dir file on windows same as linux

from libzippp.

ctabin avatar ctabin commented on August 25, 2024

When you use the methods of libzippp, remember that you are giving an entry name, not a directory path. Hence, as an entry name, only slashes (/) are interpreted as separators. The methods are not intended to handle real file paths.

Thanks for the link to dirent.h. I'm not sure yet I will include it, but it can be very useful.

from libzippp.

aijyo avatar aijyo commented on August 25, 2024

When you use the methods of libzippp, remember that you are giving an entry name, not a directory path. Hence, as an entry name, only slashes (/) are interpreted as separators. The methods are not intended to handle real file paths.

Thanks for the link to dirent.h. I'm not sure yet I will include it, but it can be very useful.

Thanks, and got it ...."you are giving an entry name, not a directory path"

from libzippp.

Related Issues (20)

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.