I was hoping someone could tell me if there is a way to store the directory structure of the files I want when creating a CAB File using makecab.exe?
Or if there are other utilities to do this and create a CAB file?
Thanks!
I found it. I am using CABARC which is out of the SDK and has a recursive option on the directory structure.
Related
I’m using Zip utility from the Info-Zip library to compress the tree of catalogs to get xlsx-file.
For that I’m using the next command:
zip -r -D res.xlsx source
source - contains the correct directory tree of the xlsx file.
But if you then look at the resulting file structure, the source directory will be included in the paths of all files and directories at the top level, and MS Office Excel will not be able to open this file. This is a well known problem. To avoid it zip.exe needs to be inside of the dest directory.
The problem is that I want to use the source code of this utility in my project, so this leads me to be unable to call my process, which will be responsible for compressing directories, to get xlsx files from these directories.
I’ve tried to find a place in the zip source code, where the parent catalog appending on the top-level happens. But seems
it is done implicitly.
Who can suggest how it can be done?
I am using fortran 95. I have a question very similar to Accessing files in sub directory of main program
The additional problem that I am having is this: I am creating files in a loop using following commands:
write(fn,fmt='(a,i0,a)')"degseqA",filenumber,'.dat'
open(unit=filenumber,file=fn)
Hence I cannot use 'output/myfile.dat' to make myfile.dat go to the directory output. Is there any way to solve this?
Thanks
If the directory already exists, it is totally straightforward.
write(fn,fmt='(a,i0,a)') "output/degseqA",filenumber,'.dat'
open(unit=filenumber,file=fn)
or in general
write(fn,fmt='(a,i0,a)') trim(directory_name)//"degseqA",filenumber,'.dat'
where directory_name is a character variable with the name of the directory.
Make sure fn is large enough.
I'm compiling CEF (Chromium Embedded Framework) for our local html5 presentation.
I should say I'm very new for all this (CEF and C++).
I've already optimized cefclient project for the presentation, but I need to embed all html/js/css/etc files into project (reading from local storage is not an option).
As I understood, I should use .zip or .pak (renamed zip) files to embed. But how can I use them inside the project?
Should I use some lib for unzipping (zlib?) or there is another popular way? And how can I be sure that files will be compiled into project?
Sorry for such basic questions but there are very few information about this (or google hates me today).
Thank you for any help!
UPD: found great tool - WBEA (http://asterclick.drclue.net/WBEA.html), it looks like exactly what I want to, but works pretty slow (with JS).
UPD 2: It turns out that there are many ways to make HTML5 desktop application, for example Node-Webkit.
Here is an article that compares some of them http://clintberry.com/2013/html5-apps-desktop-2013/
You need:
Create zip file whitin your resources.
Embed it as win32 resource (after this step you will get correct executable with .zip file inside).
Create custom scheme handler to access this zip file.
CefZipReader class will be handly to implement handler from step 3.
Look around, may be something like what you want already exist somewhere.
This sounds very similar to self extracting installers.
No need to compile anything, just concatenate the zip to the end of the executable. All you need to do is find the offset at runtime from the start of the executable. This can be done easily by writing a large magic number and looking for it later.
Example Linux:
cat app magic_number data > new_app
Example Windows:
copy app.exe /B + magic.dat /B + data.dat /B new_app.exe
I need to store a configuration file that can be changed once the executable has been compiled inside of an executable using C++. I assume the configuration file would need to be stored as a resource for it to be editable once the executable has been compiled.
I have no idea how I can go about storing it as a resource and how to then include it in the main section of my project while still leaving it in the resource section.
Any help will be much appreciated.
Windows "*.ini" files is one way.
But, I suggest use XML files for configuration. Most compilers have 2 or 3 libraries to load & store data from XML files.
Besides, they allow to store information in a hierarchical way, and easy to add or remove configuration options.
EDIT:
Another way are JSON files.
How can I zip directory in C++. I read this question: How do I zip a directory of files using C++? But I'd prefer a way that uses something like gzip, zlib and boost(because I do not want to add new libs to the project). Winapi-way is also acceptable (if it exists). And I do not want to start new process.
I would like a code sample. Thanks in advance
You want zip but you don't want to use any libraires?
Do you want to be bound by a particular licence - if so then simply copy all the code from zlib and the zip add-on into your own code.
If you can't use their licence then get the specs and write your own clean room implementation - make sure that you haven't seen the zlib or zip code base though.
The other alternative is to bundle a freely available zip command line client and call it with a system() call
edit: if you mean you are already using zlib then minizip does the directory stuff - it's usually included with zlib in the contrib directory
You can use boost iostream which includes compression functionalities. Have a look at the documentation here: http://www.boost.org/doc/libs/1_46_1/libs/iostreams/doc/index.html
It seems that in fact in this case that won't work for a directory of files.