Relative path within TZipFile - c++builder

I am trying to convert some code that used TZipForge for years to code that uses TZipFile in the RTL now. My reason is so that I can exchange files between VCL app and FMX mobile apps. I am using C++ Builder 11.2.1 for all of these apps.
The structure in the Zip file that I am struggling with is like:
folder-1\
-- file-1.xml
-- file-2.xml
file-a.xml
file-b.xml
I find that I can insert file-a & file-b without path info. I can't insert folder-1\file-1 and folder-1\file-2 because folder-1 is a relative path within the Zip file. It is not a complete path on the file system. Also, I am using IncludeTrailingPathDelimiter() so that these are OS independent path separators.
If I do this:
Zip->Add("file-1", "folder-1\\file-1");
I get a "file not found" error because folder-1\\file-1 does not exist on the file system.
Is it possible to create a relative path (folder) within a zip file and add files to that folder?

Related

Changing file path in .dpr file in delphi

We are using Delphi 6. Currently, we have kept all the different application folders under one main folder.
We have below folder path for one of the applications:
C:\dev_GIT\MyApplications\Delphi\Sales_Applications\Member_Joining
For some reason, we would like to move this folder to below folder path:
C:\dev_GIT\Member_Joining
Issue we are getting is that we have some common files which are kept in separate folders and which are used in so many other applications as well.
Since we are moving this folder outside of the current folder path, we are getting compile error, which is expected.
The real issue is, as there are so many files which are in common folder path, we need to change their path in .DPR file one by one. Is there any better way by which we need not to change path for all the files in the .DPR file?

Unable to open or even add Resource files in my Delphi 7

Every single time i either try to open or add a resource file to my project or just open it within delphi it will throw me an error (I have tried .rc,.res,.rc..all kinds of extensions) and it will say that the file has been truncated or that Delphi cannot open or add this type of file. any ideas?
You cannot open a .res file in the Code Editor, as it is a binary file. You can open an .rc file, as it is a plain text file.
You can certainly add both .rc and .res files to a project, though. The IDE should not complain about that.

Type of files created in a blackberry project

I created my first Hello world project for BlackBerry and following files were created in the deliverables folder:
- HelloWorld.cod
- HelloWorld.cso
- HellowWorld.debug
- HelloWorld.jad
- HelloWorld.jar
- HelloWorld.rapc
What is the purpose of each of these files? I know at least that the jar file must be deployed as a mobile application. But what about all other files?
The .cod file is basically BlackBerry's proprietary version of the .jar file. (This is usually the version downloaded from the App Store.)
The .cso file is a helper file used when signing the application. (It says which keys are needed.)
The .debug file is a helper file used when running the application in the debugger.
The .jad file describes the application to help the device know if it's compatible. (If you were downloading onto a BlackBerry from a website instead of the App Store, this is the file you'd point your link at, which would contain the path to the cod/jar.)
The .jar file is the main application file for MIDP, which is sort of a generalised mobile java runtime environment.
The .rapc is a helper file used by the BlackBerry JDE when it's compiling/building the project.

where to find "package com.rim.samples.docs.notifications;"

i a developing blackberry aplication using eclipse can any one tell where to find the following library
package com.rim.samples.docs.notifications;
i have downloaded it from blackberry site but i dont know how to use it
com.rim.samples.docs namespace is common for samples BlackBerry Application Developer Guide.
On the other hand, "package" token defines the packege namespace, not the import.
If you have downloaded code and post it to namespace with other name, you may have trouble to compile it. Resolve it in two ways:
1. if your code file is placed directly in project src folder, simply remove
package com.rim.samples.docs.notifications;
from code, this will set namespace to default.
2. in project src folder create folder "com\rim\samples\docs\notifications" and move file to folder "notifications".

How do I link a dynamic library with qmake into my app?

In my qmake .pro file I add my desired dynamic library to LIB which allows for compilation but doesn't link to the library in the compiled application (i.e. I get a library not found error at run time).
The problem is that I have the library in my build directory, not in the system directory (i.e. /usr/lib). But, I want to generate a OSX app that doesn't touch the system outside of the .app folder.
Also, I'd link to know how to do this on a linux system - is it possible?
My question is related to the Qmake generating a proper .app question but differs in that the link that answers that question doesn't answer my question.
Put a wrapper script round your program so the current working directory is in the dynamic library search path:
#!/bin/bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
./program

Resources