[HPADM] Summary:Max Record Length.

From: Scalone, Galen (Galen.Scalone@vacationclub.com)
Date: Mon Mar 17 2003 - 11:19:21 EST


List,
Many replies, thanks to the following:

Ed
Eef Hartman
Bill Hassell
and
Corne Beerse.

The gist is, it depends on what will be done to the file. Some commands
assume a max record length, and will error once that threshold is reached.
It could also depend on the application acting on that file. It too may
assume a max rec length.

>From Ed:
Hi,

Actually, the answer is yes and no.
No, there is nothing to stop you from creating endless amounts of
characters in one single line. And yes, several unix commands, such as
awk, vi etc. assume a maximum line length.

So it depends on what is going to process your file.

Best regards,
Edward

>From Eef:
No fundamental one, it will depend on the program processing the file
(and the size of buffer IT uses to process the line in).
Note that the concept "line" doesn't exist in files itself, the program
reads in chars untill it finds a "newline".

For instance scanf ("%s\n",charptr); will read in chars up to the newline
and you HOPE the buffer "charptr points TO" will be large enough to receive
it (the well-known buffer overflows in "security alerts" come from program
code that did NOT test for this!).

>From Bill:

Yes. It is found with:

getconf LINE_MAX

which will be either 2k or 2megs depending on your patch level.
Generally when this question comes up, it involves filenames
such as listing files names in a particular directory like this:

   ls *
   ls /var/tmp/lotsa_files/*

The * is automatically replaced with names of matching files and
if the are several thousand, even the 2meg line length is not long
enough. The is why xargs was created (man xargs).

Galen Scalone
Sr. Technical Analyst
Marriott Vacation Club International
863 688 7700 X4430
galen.scalone@vacationclub.com

This communication contains information from Marriott International, Inc.
that may be confidential. Except for personal use by the intended recipient
or as expressly authorized by the sender, any person who receives this
information is prohibited from disclosing, copying, distributing, and/or
using it. If you have received this communication in error, please
immediately delete it and all copies, and promptly notify the sender.
Nothing in this communications is intended to operate as an electronic
signature under applicable law.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:27 EDT