Date: Sat, 14 Jan 2012 09:28:21 +0100 From: Polytropon <freebsd@edvax.de> To: Robert Bonomi <bonomi@mail.r-bonomi.com> Cc: freebsd-questions@freebsd.org Subject: Re: access(FULLPATH, xxx); Message-ID: <20120114092821.adfc43eb.freebsd@edvax.de> In-Reply-To: <201201140800.q0E80CSS035179@mail.r-bonomi.com> References: <20120114000513.GA17888@thought.org> <201201140800.q0E80CSS035179@mail.r-bonomi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Jan 2012 02:00:12 -0600 (CST), Robert Bonomi wrote: > To repeat some advice from one of my Computer Science professors, many years > ago, whenever I asked 'how does it work' questions: "Try it and find out." I bet my professor can beat up your professor. :-) Mine used to say several times: "Trial and error is NOT a programming concept!" However, your suggestion of creating a simple test case, together with consulting the documentation, is a fully valid approach to discover what format path should be in the int access(const char *path, int mode); function. Luckily, we _have_ that kind of documentation in FreeBSD where the answer is just "man 2 access" away. Other operating systems (or excuses thereof) do not offer this simple and still helpful thing. > You see, the *ONLY* thing that matters is 'what the machine does'. And, > a trivial test case will give an _authoritative_ answer. Anything that > anybody says about 'how it works' is merely an *opinion*, and they could > be wrong. The test case will, however, ALWAYS give you the 'hard truth' > about how it works in your environment. Especially when interpreting the content of the manual is debatable (as it is at least for me in this specific case), a simple test would reveal the truth of what will actually happen. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120114092821.adfc43eb.freebsd>