Sponsored Content
Top Forums UNIX for Advanced & Expert Users Another binary manipulation thread. Post 302854609 by wisecracker on Tuesday 17th of September 2013 05:22:30 PM
Old 09-17-2013
Hi DGP...
Code:
0000000   ! 001 002 003 004 005 006 007  \b  \t  \n 013  \f  \r 016 017
        041 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017
0000020 020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
        020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
0000040       !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /
        040 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057
0000060   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
        060 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077

The problem is the same as mine, in that address 0x41 is also a(n) "!" so is this a binary zero or a real "!".
There is no way of knowing so I thought of using "@@" to substitute for binary zero as "\@" would present a similar problem as my "\0", but, would import into "read" easily.
But again "@@" may actually exist as real characters and not a substitution but at least it is starter approach to emulating binary zero...

I'll give it a whirl tomorrow...

HTH...
 

4 More Discussions You Might Find Interesting

1. Programming

How to cancel a thread safely from the initial thread?

how about asynchronous canceling? or with signal? if with signal whether it effects the process? my english so badly :( :( (1 Reply)
Discussion started by: alan.zhao
1 Replies

2. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

3. Shell Programming and Scripting

Another Building Block, Binary File Manipulation...

Apologies for any typos, and IF this has been done before... This is yet another building block. The code generates a 256 byte binary file of _characters_ 0x00 to 0xFF for general usage and generates another binary file manipulated in a basic way. I need this facility for a kids project I am... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Not able to post thread/reply to thread

Dear Moderator I am not able to post any new thread or post reply to mine old thread. Kindly help as i am stuck on one problem and needed suggestion. Regards Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies
STRCAT(3)						     Linux Programmer's Manual							 STRCAT(3)

NAME
strcat, strncat - concatenate two strings SYNOPSIS
#include <string.h> char *strcat(char *dest, const char *src); char *strncat(char *dest, const char *src, size_t n); DESCRIPTION
The strcat() function appends the src string to the dest string, overwriting the null byte ('') at the end of dest, and then adds a ter- minating null byte. The strings may not overlap, and the dest string must have enough space for the result. The strncat() function is similar, except that * it will use at most n characters from src; and * src does not need to be null-terminated if it contains n or more characters. As with strcat(), the resulting string in dest is always null-terminated. If src contains n or more characters, strncat() writes n+1 characters to dest (n from src plus the terminating null byte). Therefore, the size of dest must be at least strlen(dest)+n+1. A simple implementation of strncat() might be: char* strncat(char *dest, const char *src, size_t n) { size_t dest_len = strlen(dest); size_t i; for (i = 0 ; i < n && src[i] != '' ; i++) dest[dest_len + i] = src[i]; dest[dest_len + i] = ''; return dest; } RETURN VALUE
The strcat() and strncat() functions return a pointer to the resulting string dest. CONFORMING TO
SVr4, 4.3BSD, C89, C99. SEE ALSO
bcopy(3), memccpy(3), memcpy(3), strcpy(3), strncpy(3), wcscat(3), wcsncat(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2008-06-13 STRCAT(3)
All times are GMT -4. The time now is 09:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy