NTNU-IHB / FMI4cpp

FMI 2.0 implementation written in modern C++.
MIT License
95 stars 35 forks source link

unzip is not unzipping subdirectories #65

Closed lab-ned closed 5 years ago

lab-ned commented 5 years ago

in fmu::fmu, unzip is called, and it finds the appropriate files. However, those in the subdirectories (e.g. binaries/win64) are not written to the uncompressed temp location. I see logic in unzipper if (sb.size == 0) { fs::create_directories(newFile); } else { that is meant to catch the directories and create them, but it never executed. Is there a specific compression method needed so that libzip finds the directories first? I used normal windows compressed folder creation and 7zip without success.

markaren commented 5 years ago

Does this happen with all FMUs you've tested or only the ones you've made yourself?

lab-ned commented 5 years ago

Thanks

. strangely enough, it does not happen for any of the FMU's I've tried in the FMI4cpp package. In those, I see the individual folders appearing before the files in the unzip loop, so the "if(sb.size == 0)" condition is encountered for those folders before the actual files are, so all seems well.

It must be my compression somehow. I'm not sure if I need to use something besides Windows explorer compression or 7zip. The FMI spec says I need to use "deflate", so I'm looking for a method where I know that is happening. My bouncing ball is attached... beware it has some other issue where init works in my C tester but not here. No doubt, I have problem in my code on that one. CRBouncingBall.zip

lab-ned commented 5 years ago

User Error! Please don't bother further. I figured out how to deflate with 7Zip, although it was not immediately obvious. FMI4cpp now decompresses the FMU. Thanks for your time Lars.