Sponsored Content
Full Discussion: Padding issues
Top Forums UNIX for Advanced & Expert Users Padding issues Post 16443 by AtleRamsli on Friday 1st of March 2002 12:51:34 PM
Old 03-01-2002
If you are talking about stuff like this:

struct foo
{
int bar;
char c;
DEFIT honk;
long snafu;
};

...
struct foo *pfoo = malloc( ...);
...

send_from_1_2_other(pfoo, ....);
...

This is a bad idea.
It will only work inside an absolutely heterogenous, eh, structure.
You would want to either have a conversion routine in each end, like ntohfoo(), htonfoo() modelled after the int and long ones, or, depending on the contents, you might want to transfer in ASCII, taking performance issues into account.

Atle
 

10 More Discussions You Might Find Interesting

1. Programming

Zero Padding to a string

I am writing a C program which a part of it needs to padding zero in front of a string. The program will get a sting from an ASCII file which the maxium length of this string is 5 char long. The string can sometimes less the 5 char long. In order to make it with the same length '0's are being... (3 Replies)
Discussion started by: Wing m. Cheng
3 Replies

2. UNIX for Dummies Questions & Answers

Padding

Hi Can anyone tell me how to pad zeroes on the left side to a numeric string in unix shell scripting Your answer is very much appreciated Thanks Vijay (2 Replies)
Discussion started by: vijaygopalsk
2 Replies

3. Programming

Byte Padding

Hi, Can someone explain what is byte padding? For ex: struct emp{ char s; int b; char s1; int b1; long b3; char s3; } What will be the size of this structure? Thanks (6 Replies)
Discussion started by: naan
6 Replies

4. Shell Programming and Scripting

Padding in Unix

I have a file with different character counts on each line how do i make it with unique character counts. example: 1st line : ABCD 011 XYZ 0000 YYYY BBB TEADINGDA 2nd line: ABCD 011 xys 0010 YYYY BBB TEAD 3rd line : ABCD 022 YXU 000 UUU BBB TE 1st line is 43... (3 Replies)
Discussion started by: rudoraj
3 Replies

5. UNIX for Dummies Questions & Answers

Zero padding dates

I have a file with records containing dates like: SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|2007-6-6|MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|2003-11-6|SL# MD CONTACT-LIZ RICHARDS|||0|Y|N||1411458| How can I get the date fields in each of my records to be... (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

6. Shell Programming and Scripting

Padding with zeros.

Hi Friends, I would like to left pad with "0's" on first column say (width six) I have a large file with the format: FILE: 1: ALFRED 84378 NY 8385: JAMES 88385 FL 323: SMITH 00850 TX My output needs to be like: 000001: ALFRED 84378 NY 008385: JAMES 88385 FL 000323: SMITH... (10 Replies)
Discussion started by: sbasetty
10 Replies

7. Shell Programming and Scripting

fixed length text file padding issues in AIX

Hi, I have a fixed length text file that needs to be cut into individual files in aix and facing padding issues. If I have multiple blank spaces in the file it is just making it one while cutting the files.. Eg:- $ - blank space filename:file.txt ... (2 Replies)
Discussion started by: techmoris
2 Replies

8. Shell Programming and Scripting

Padding leading zero

hi All i am new to linux... source txt .. 281-BUM-5M BUM-5M 0 0 282-BUM-5M BUM-5M 0 0 83-BUM-5M BUM-5M 0 0 is it possible to use bash script to convert to (remove the "-" and fill up to 4 digit" ? 0281 BUM-5M BUM-5M 0 0 0282 BUM-5M BUM-5M 0 0 0083 BUM-5M BUM-5M 0 0 thanks a ... (5 Replies)
Discussion started by: samoptimus
5 Replies

9. Programming

Padding issues between Sparc and Intel

Hello, I'm facing severe structure padding issues when my Solaris C/C++ application that runs on Sparc communicates with the same C/C++ application that runs on Intel. I know that Sparc and Intel use different padding patterns. So when it comes to reading the exchanged structure data, both... (11 Replies)
Discussion started by: Goseib
11 Replies

10. Shell Programming and Scripting

Padding a csv value with 0's

I have this csv file that I would like to sort on the 20th and 21st field. They are high lighted below. My challenge is that when I sort on those fields they are not in order as I would have liked. It seems like I have to pad those fields to the longest value in that fields data. ... (6 Replies)
Discussion started by: GroveTuckey
6 Replies
emacs(1)						      General Commands Manual							  emacs(1)

NAME
emacs, xemacs - emacs editor DESCRIPTION
The emacs software is unsupported software that is provided as part of Tru64 UNIX. Compaq will fix problems in this unsupported software only if they are specific to Tru64 UNIX. Compaq will not fix problems that are integral to the software itself or that occur when the com- ponent is used on UNIX systems other than Tru64 UNIX. Compaq will not add functionality to this software. Except for this reference page, other reference pages that Tru64 UNIX supplies for emacs are passed through without changes. The reference pages distributed as part of this software are available in the directories /usr/share/doclib/annex/man/man[1-9]. You should use this directory stem in the man command or add it to the MANPATH environment variable to make these files available to the man command. Note Compaq is not responsible for the content or quality of reference pages and other documents installed under the /usr/share/doclib/annex directory and does not revise this material in response to customer problem reports. Reference pages installed under the /usr/share/doclib/annex/man directory are not available from Compaq in book form; for example, they are not included in the reference manu- als that you receive when you order the Tru64 UNIX documentation set as hard copy books. Problems related to the content or quality of any documentation installed in the /usr/share/doclib/annex directory tree should be sent to the developers of the documentation. The format for changing the search path with the man command is: man -P /usr/share/doclib/annex/man [section] title... If you are using the Bourne, Korn, or POSIX shells, use the following command sequence to modify your environment: MANPATH=$MAN- PATH:/usr/share/doclib/annex/man export MANPATH If you are using the C shell, enter the command: setenv MANPATH `echo $MANPATH`:/usr/share/doclib/annex/man See the reference pages for the man(1) command for additional information on the search path used to locate files. The reference pages associated with this product are not included in the whatis data base created by the catman command. Therefore, the man -k and apropos commands will not locate reference pages included with this product. SEE ALSO
Commands: apropos(1), catman(8), man(1) emacs(1)
All times are GMT -4. The time now is 07:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy