Sponsored Content
Full Discussion: cksum parts of a file
Top Forums UNIX for Dummies Questions & Answers cksum parts of a file Post 25397 by auswipe on Monday 29th of July 2002 06:15:33 PM
Old 07-29-2002
Quote:
Originally posted by Perderabo
I don't know of a solution. Smilie
SmilieYou scare me when you say that!Smilie

Hmmmm...

Is the time-date stamp always the same offset from the beginning of the file and a fixed length? If so, you could copy the entire executable minus the timestamp (leave blank or fill with some character) into a temp file, run CRC32 (MD5, whatever) against it and then do the same with the second file and then compare CRCs to determine if the files are different or not.

I would think that you would have to generate the temp file by fseek'ing byte after byte into the temp binary file leaving out the timestamp. Of course, the temp file probably couldn't be executed but it oughta be good for comparison sake since both files would have had the common timestamp effectively removed.

I tried your example under FreeBSD and md5 reported that both executables were the same so I didn't try any further.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getting parts of a file

Hello, I'm trying to retreive certain bits of info from a file. the file contains a list like this info1:info2:info3:info4 info1:info2:info3:info4 info1:info2:info3:info4 info1:info2:info3:info4 how do i pick out only info2 or only info3 without the others? Thanks (11 Replies)
Discussion started by: bebop1111116
11 Replies

2. Shell Programming and Scripting

Extracting parts of a file.

Hello, I have a XML file as below and i would like to extract all the lines between <JOB & </JOB> for every such occurance. The number of lines between them is not fixed. Anyways to do this awk? ============ <JOB APR="1" AUG="1" DEC="1" FEB="1" JAN="1" JUL="1" JUN="1" MAR="1" MAY="1"... (3 Replies)
Discussion started by: srivat79
3 Replies

3. Shell Programming and Scripting

Splitting a file into unequal parts

How do I split a file into many parts but with different amounts of lines per part? I looked at the split command but that only splits evenly. I'd like a range specified to determine how many lines each output file should have. For example, if the input file has 1000 lines and the range is... (1 Reply)
Discussion started by: revax
1 Replies

4. Shell Programming and Scripting

find file with space and cksum

find . -type f | xargs cksum this command is failing for the files which has a space in between them any quick solution ? preferably one liner (2 Replies)
Discussion started by: reldb
2 Replies

5. UNIX for Dummies Questions & Answers

How to swap parts of a file name?

I have a number of files that a structured like this: Eg. file_name.ext1 another file name with spaces.ext2 yatf with .ext3 also a file (plus).ext4 I would like to swap the part with the descriptive_file_name part, so that it looks like this: Eg. file_name .ext1 I know (or... (4 Replies)
Discussion started by: invenio
4 Replies

6. Shell Programming and Scripting

extract certain parts from a file

I have a logfile from which i need to extract certain pattern based on the time but the problem here is the time is not same for all days. Input file: Mon 12:34:56 abvjingjgg Mon 12:34:57 ofjhjgjhgh . . . Mon 22:30:00 kkfng . . . Mon 23:12:23 kjgsdafhkljf . . . Tue 01:04:54... (8 Replies)
Discussion started by: gpk_newbie
8 Replies

7. Shell Programming and Scripting

Extract Parts of File

Hello All, I have a file like this Define schema flat_file_schema ( a varchar(20) ,b varchar(30) ,c varchar(40) ); (Insert into table ( a ,b ,c ) values ( 1 ,2 ,3 ); (4 Replies)
Discussion started by: nnani
4 Replies

8. Shell Programming and Scripting

Combine two parts of a file

Hello All, I have a file like this APPLY ( 'INSERT INTO brdcst_media_cntnt ( cntnt_id ,brdcst_media_cntnt_cd ,cntnt_prvdr_cd ,data_src_type_cd ,cntnt_titl_nm ,cntnt_desc ,batch_dt ,batch_id ) VALUES ( :cntnt_id (3 Replies)
Discussion started by: nnani
3 Replies

9. Shell Programming and Scripting

Incrementing parts of ten digits number by parts

I have number in file which contains date and serial number: 2013101000. The last two digits are serial number (00). So maximum of serial number is 100. After reaching 100 it becomes 00 with incrementing 10 which is day with max 31. after reaching 31 it becomes 00 and increments 10... (31 Replies)
Discussion started by: Natalie
31 Replies

10. Shell Programming and Scripting

Split file into n parts.

Hi all: I have a 5-column tab-separated file. The only thing that I want to do with it is to split it. However, I want to split it with a 80/20 proportion -- randomized, if possible. I know that something like : awk '{print $0 ""> "file" NR}' RS='' input-file will work, but it only... (6 Replies)
Discussion started by: owwow14
6 Replies
d2i_SSL_SESSION(3)						      OpenSSL							d2i_SSL_SESSION(3)

NAME
d2i_SSL_SESSION, i2d_SSL_SESSION - convert SSL_SESSION object from/to ASN1 representation LIBRARY
libcrypto, -lcrypto SYNOPSIS
#include <openssl/ssl.h> SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length); int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); DESCRIPTION
d2i_SSL_SESSION() transforms the external ASN1 representation of an SSL/TLS session, stored as binary data at location pp with length length, into an SSL_SESSION object. i2d_SSL_SESSION() transforms the SSL_SESSION object in into the ASN1 representation and stores it into the memory location pointed to by pp. The length of the resulting ASN1 representation is returned. If pp is the NULL pointer, only the length is calculated and returned. NOTES
The SSL_SESSION object is built from several malloc()ed parts, it can therefore not be moved, copied or stored directly. In order to store session data on disk or into a database, it must be transformed into a binary ASN1 representation. When using d2i_SSL_SESSION(), the SSL_SESSION object is automatically allocated. The reference count is 1, so that the session must be explicitly removed using SSL_SESSION_free(3), unless the SSL_SESSION object is completely taken over, when being called inside the get_session_cb() (see SSL_CTX_sess_set_get_cb(3)). SSL_SESSION objects keep internal link information about the session cache list, when being inserted into one SSL_CTX object's session cache. One SSL_SESSION object, regardless of its reference count, must therefore only be used with one SSL_CTX object (and the SSL objects created from this SSL_CTX object). When using i2d_SSL_SESSION(), the memory location pointed to by pp must be large enough to hold the binary representation of the session. There is no known limit on the size of the created ASN1 representation, so the necessary amount of space should be obtained by first calling i2d_SSL_SESSION() with pp=NULL, and obtain the size needed, then allocate the memory and call i2d_SSL_SESSION() again. Note that this will advance the value contained in *pp so it is necessary to save a copy of the original allocation. For example: int i,j; char *p, *temp; i = i2d_SSL_SESSION(sess, NULL); p = temp = malloc(i); j = i2d_SSL_SESSION(sess, &temp); assert(i == j); assert(p+i == temp); RETURN VALUES
d2i_SSL_SESSION() returns a pointer to the newly allocated SSL_SESSION object. In case of failure the NULL-pointer is returned and the error message can be retrieved from the error stack. i2d_SSL_SESSION() returns the size of the ASN1 representation in bytes. When the session is not valid, 0 is returned and no operation is performed. SEE ALSO
ssl(3), SSL_SESSION_free(3), SSL_CTX_sess_set_get_cb(3) 1.0.1i 2014-08-10 d2i_SSL_SESSION(3)
All times are GMT -4. The time now is 08:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy