Difference between file .crypt and .crypt5 - file

What is the difference between the files with an extension .crypt versus file with and extension .crypt5?

.crypt5 is the newest version of What's App database files, actually they are using .crypt7 now (29/04/2014)
There are ways to convert .crypt5 to crypt but I'm still researching. I'll get back to the thread once I'm done.

Related

Embed the image build time in code

We constantly run into issues where we are running different C images on different machines. Since our code is still in production, we keep generating binaries that folks use. Often lot of time is spent in debugging only to learn later that the binaries were incorrect.
I was wondering if there is some mechanism with which I could print the date and time when I had compiled the code then we could use that to ensure that all binaries are the same.
Any idea on how I can do this in C? I want to print the time and date when I built this image along with the version number.
The __DATE__ and __TIME__ macros are predefined by the compiler with the date and time that a C program is built. These are just string literals of the format "Mmm dd yyyy" and "hh:mm:ss" respectively, so should be easy to use with any logging or printing system. (These macros are defined in the C11 standard section 6.10.8.1)
It's called versioning:
First, add a dedicated source file which uses the compile time strings __DATE__ and __TIME__.
For example:
printf("%s %s",__DATE__,__TIME__);
Or if you want to be able to extract information from these strings:
char _date[] = __DATE__; // the format is "Jan 1 2000"
char _time[] = __TIME__; // the format is "00:00:00"
// Now use these variables to extract the data...
Then, make sure that whenever you change any file in your project, the dedicated source file will be recompiled. You can typically apply this in your project settings pre-build configuration, by invoking a script which deletes the object file corresponding to the dedicated source file.
For example, let's assume that the name of the dedicated source file is version.c, the extension of object files is obj, and the location of object files relatively to the project is debug\obj.
If you are running your build tools over Windows, then you may invoke the following batch file:
set VERSION_FILE="debug\obj\version.obj"
if exist %VERSION_FILE% del /q %VERSION_FILE%

I have a .c.save file. What is it? What does it do?

I am programming with C using Code::Blocks. My project is divided in 3, header, implementation and main.
Whenever I used a project, apart from the source files and the bin and obj folders I had a .depend and a .layout file. All good.
Now I created a new project, and just copied -> pasted everything new in source files. I did this twice.
For each case, I have a .c.save file, which has the same name of the implementation file (ie. the implementation file is called imp, then the file is called imp.c.save). I asked a friend of mine what it might be, and he said I need to beware as he had two random files created, which prevented him from building correctly (he got a stupid error). When the files were deleted everything went back to normal.
I did a short test of the program and I can find nothing different. I am hesitant to delete it since this cropped up twice in two cases, but I don't want to compromise my coding.
Tried to google and I didn't find much. Any help?
Well, it didn't cause any problems so I assuming it is an autosave file.

what is the meaning of stable in zfile_stable - CZMQ

CZMQ man page for zfile explains zfile_stable as:
// Check if file is 'stable'
CZMQ_EXPORT bool zfile_stable (const char *filename);
What is the meaning of stable? when a file is said to be stable?
The use case here is using files to signal between processes. The example application is FileMQ, which publishes new files out to subscribers. But there's no obvious way to know when a file has been "created"; the two solutions I know are to create a second "signal" file, which is rather clumsy, or to use this "has the file been modified in the last second" algorithm.
Let's say you're copying photos into one directory, and a parallel process is detecting new photos and uploading them to a server. On a large photo, the modified date will keep changing until it's stable. Then, it's safe to upload the photo.
Hope that helps.
The definition of stable in this context is if a file more than 1s old.
See https://github.com/zeromq/czmq/blob/master/src/zfile.c#L115

Powerflex Database File extensions

I am trying to understand the different file extensions for the pfxplus powerflex database. Could someone please help telling me briefly what each file is for?
.k1
.k2
.k3
...
.k13
.k14
.k15
.fd
.def
.hdr
.prc
.pc3
Data files:
OK, so .dat is the data file.
.k1 -> .k15 are index files.
These are the critical data files for runtime. (Combined with filelist.cfg or pffiles.tab similar to define what files are available overall).
.fd is the file definition, needed for compiling programs
.tag (which you did not mention) is needed only if you need to access field names at run time (such as using a generic report tool)
.def is the file definition in human readable form, and is not needed by any process but is produced so a programmer or user can understand the file structure.
Run time:
The .ptc files are the compiled threads interpreted by the powerflex runtime.
The .prc file is a resource file that is used at runtime in conjunction with the .ptc file - it defines how a character based program is to look in a gui environment in "g-mode". It was the cheap way to upgrade character based programs when windows first started getting popular usage.
.hdr and .pc3 escape me at the moment, but are vaguely familiar - .hdr is probably another data file used with compression or special field types for later versions of pfxplus. .pc3 may in fact be the .ptc files...

make file running on Linux - how to ignore case sensitive?

I have a huge project, whole written in C language and I have a single make file that is used to compile it. The project C files contains lots of capitalize problems in it's header files, meaning there are tones of header files that were miss-spelled in lots of C files.
The problem is I need to migrate this project to compile on Linux machine and since Linux is case sensitive I got tones of errors.
Is there an elegant way which I can run make file in Linux and tell him to ignore case sensitive?
Any other solution will be welcome as well.
Thanks a lot.
Motti.
You'll have to fix everything by hand and rename every file or fix every place with #include. Even if you have a huge project (comparable with linux kernel), it should be possible to do this during a hour or two. Automation may be possible, but manual way should be better - because script won't be able to guess which name is right - filename, or the name used in #include.
Besides, this situation is a fault of original project developer. If he/she wasn't sloppy and named every header in every #include correctly, this wouldn't happen. Technically, this is a code problem similar to syntax error. The only right way to deal with it is to fix it.
I think it takes not too long to write a small script, which goes thru the directories first, then replaces C headers. Explained:
Scan the headers' folder and collect filenames.
Make a lowercase list of them. You have now original and locased pairs.
Scan the C source files and find each line contains "#include"
Lowercase it.
Find the lowercase filename in the list collected and lowercased from headers.
Replace the source line with the one collected from headers.
You should put the modified files into a separate folder structure, avoid overwriting the whole source with some buggy stuff. Don't forget to create target folders during the source tree scan.
I recommend a script language for that task, I prefer PHP, but just it's the only server-side script language which I know. Yep, it will run for a while, but only once.
(I bet that you will have other difficulties with that project, this problem is not a typical indicator of high quality work.)
Well I can only tell you that you need to change the case of those header files. I don't know that there is any way you can make it automatic but still you can use cscope to do it in a easier way.
http://www.linux-tutorial.info/modules.php?name=ManPage&sec=1&manpage=cscope
You can mount the files on a case-insensitive file system. FAT comes to mind. ntfs-3g does not appear to support this.
I use the find all and replace all functionality of Source Insight when i have to do complete replacement. But your problem seems quite big, but you can try the option to replace every header file name in all occurences of source files using the
"Find All" + "Replace" functionality. You can use notepad++ too for doing the same.
A long time ago there was a great tool under MPW (Macintosh Programmer's Workshop) called Canon. It was used to canonize text files, i.e. make all symbols found in a given refernce list have have the same usage of upper/lower case. This tool would be ideal for a task like this - I wonder if anything similar exists under Linux ?

Resources