ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On an international web site, what would be a suitable length for the following entries:
-First name or Christian name
-Second name or middle name
-Surname or last name
-Street and number
-Town or city
This is required for the CGI that will handle the results of the HTML form since the data cannot be truncated and the format of the file that will hold the data has to be decided accordingly.
The main concern is for example some Asian names are extremely long compared to Westen ones.
Is there anyone with this sort of experience who can provide advice?
This means reading the whole file when a member makes a change like a change of address. It also means if the new info supplied by the member is longer than the old one it won't fit and would have to be relocated.
We prefer simplicity over saving a bit of disk space.
That is correct. It's not "users" I am talking about, it is "members" and it is not a database but a flat file but we're getting away from the subject. The choice between a database or a flat file was made a long time ago.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
As a non native english speaker, I'm not going argue about semantics but I'm still quite sure these international site members are also this site's users ...
Anyway, it is certainly possible to have variable lenght names stored in flat files: CSVs, GEDCOM, XML and the likes do it easily, in fact fixed length data files is the exception.
The initial choice to have fixed lenght fields was a wrong design decision, and trying to figure out what other arbitrary maximum lenght is to be decided is probably still a wrong decision, unless you set an urealistic high mark (i.e. 256 characters for each field), which may hurts if your members count is in the million zone.
You may also need to set some string length limits in your CGIs to prevent buffer overflow attacks, depending on the back-end programming language.
Pour quelqu'un dont la langue maternelle n'est pas l'anglais, votre anglais est parfait et vous n'auriez pas de difficultés a discuter les moindres détails.
Nous ne sommes pas une organisation commerciale et cela implique beaucoup de changements en ce qui concerne les coutumes de logiciels, parfois nous devons faire l'opposé de ce qui serait fait normalement.
Cependant, nous avons des difficultés a introduire un système de sécurité et il est possible qu'a la suite de cela, nous allons changer ce fichier en zones de longueur variables. Pas mal d'autres points doivent être discutés avant.
Ceci ne me fait pas abandonner mon idée de trouver, si possible, quelqu'un qui a de l'expérience en ce qui concerne ma question.
Je vous remercie pour vos commentaires qui sont définitivement valables et ne sont pas ignorés.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.