From: Phred Phungus on 18 Feb 2010 23:42 Seebs wrote: > On 2010-02-15, Phred Phungus <Phred(a)example.invalid> wrote: >> Then how does one determine PATH_MAX given a directory? > > In comp.unix.shell, one doesn't -- the shell doesn't have to pre-allocate > storage for strings. If you want to know how to do it in C, try > comp.unix.programmer. :) > > -s I'm trying both. I must look like I proceed glacially, but this is what I do after my workday, which was nothing to sneeze on today. -- fred
From: Seebs on 19 Feb 2010 12:38 On 2010-02-19, Phred Phungus <Phred(a)example.invalid> wrote: > $ getconf PATH_MAX $/etc/ > 4096 > $ > > I didn't guess wrong. I've been watching you post both here and in comp.lang.c for months, and you seem to have a very fundamental misunderstanding about the nature of computers and programming. Computers are not all the same, and they can change over time. New software may be different from old software. What allows you to write code that will still work next week, next month, or next year, is being aware that there's a difference between "what happened this time" and "what I can be sure will happen". The point isn't that the value in question is necessarily wrong today for a specific path. It's that if you write code which will blow up if that value ever changes, you're going to be screwed. It is MUCH CHEAPER in the long run to write the code correctly the first time. You spend a lot of time trying to figure out exactly what happens, which could be a good trait, except you don't seem to be able to understand that "exactly what happens" on a particular machine on a particular day may NOT be "exactly what happens" on a different machine, or after a software upgrade. The solution is not "do a test to find out what happened once, then commit to relying on exactly that happening every time thereafter", but to understand the mechanisms for writing code that will be robust in the face of changes. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
First
|
Prev
|
Pages: 1 2 3 4 5 6 Prev: script to format a csv date Next: pine copy emails back to the server... |