Write a program that extracts the contents of an RPM file on Windows - c

I am looking to write a program that will extract the contents of an RPM file and do some validation checks. I'll be using Qt for the interface so that the program can be run in Windows and Linux.
Are there any suggestions for extracting the contents for an RPM file on Windows? I would prefer a C library, but other suggestions are welcome also.

rpmlib looks like what you are after.

Related

How to add a file to your C exe win32

I have a chrome extension that works with my exe file. I want to deliver just one exe file to my client. I tried converting the zip file into hex, but then I get a string with 25 thousand lines. I don't think that's the right way to do it.
How can I deliver my zip file with my exe?
What you are trying to do is definitely doable, I've seen it being done many times.
If you have MinGW installed, you can use xxd tool that will do the trick for you.
xxd -i your_zip_filename embedded_zip_data.h
Now you simply add #include "embedded_zip_data.h" in your source code and it will be right there in the application data.

Is there a way to get Aginity Workbench to write Unix files rather than Windows files (LF only rather than CR\LF)

Is there a way to get Aginity Workbench to write Unix files rather than Windows files (LF only rather than CR\LF)?
"My" developers check their code into SVN on Windows, and then we check it out into a development environment, and it's ... complicated, but doing a tr -d \r on every file on checkout is problematic.
Thanks.
Why don't you use dos2unix utility to get proper file encoding?
Anyway, there is Aginity Support portal by the link below. You can submit your question there:
https://support.aginity.com/hc/en-us/community/topics
In Workbench you can actually recode a text file to convert it from one encoding to another. Tools menu -> File Utilities -> Re-code a text file.

How can I package a configuration file with a C program?

I am currently trying to build a new version of a piece of software I developed. The software takes a simple command line argument and appends the argument to the end of a file. My problem is that I want to alter the program so:
Someone can set up a standard location to save the file to.
The program will remember that location.
It will still work for anyone installing the C program on mac, linux or windows.
So basically I am trying to figure out how to create a C executable that comes with persistent memory that it can read and modify. Alternatively I would take any way to create an installer to make this easy for anyone who wants to use my program.
If this were a java program I would just add it to the jar file but I have never seen this documented for the C language.
I would add platform-specific code to store your settings in whatever area users of that particular platform expect. So:
For Linux: store configuration files in the location specified by $XDG_CONFIG_HOME.
For Mac: Use CFPreferences
For Windows: use the registry

how to load a hex file into a microcontroller using batch

I'm trying to write a batch file that does a few things... having trouble with it.
I can't find any examples to help me, but what I need is...
run 3rd party program to create 1 .hex file
load that and 2 other .hex files into a microcontroller
in windows 2000 and above, you cannot do this. due to the limitations of batch.
in DOS you would be able to, with the APPEND command, but it doesn't exist in new operating systems.
Bill Gates just took it out.

How to retrive binary version number from binary files

I am using Eclipse IDE for developing the c programs. Through terminal I can see the file info using file filename .But I need to print only the version number of a binary file through the same code.I think the eclipse IDE keeps the build and debugging versions .How to retrive binary version number from binary files ?.
Thanks .
The "file" utility is a non-trivial implementation, ie., no straight-forward system calls for getting all those information. You have two options:
Get the source code of "file" utility (here) and manipulate it
for your goal
Easier: use popen(), run file command, retrieve the
output and parse it to get the information you want. The command file <filename> | cut -d"," -f3 should directly give you the version of the executable.
An example of using popen() here
Hope this helps.

Resources