From owner-freebsd-questions@FreeBSD.ORG Sat Jan 14 08:28:23 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 907D5106564A for ; Sat, 14 Jan 2012 08:28:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 547F38FC08 for ; Sat, 14 Jan 2012 08:28:23 +0000 (UTC) Received: from r56.edvax.de (port-92-195-26-82.dynamic.qsc.de [92.195.26.82]) by mx02.qsc.de (Postfix) with ESMTP id 2EB571E4C4; Sat, 14 Jan 2012 09:28:22 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q0E8SLHw004158; Sat, 14 Jan 2012 09:28:21 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 14 Jan 2012 09:28:21 +0100 From: Polytropon To: Robert Bonomi 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> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: access(FULLPATH, xxx); X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 08:28:23 -0000 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, ...