From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 6 01:00:57 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD1FD16E587 for ; Tue, 6 Jun 2006 00:08:35 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from smtp.utwente.nl (smtp1.utsp.utwente.nl [130.89.2.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5F0643D58 for ; Tue, 6 Jun 2006 00:08:34 +0000 (GMT) (envelope-from pieter@degoeje.nl) Received: from nox.student.utwente.nl (nox.student.utwente.nl [130.89.165.91]) by smtp.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id k5608Txt013860; Tue, 6 Jun 2006 02:08:29 +0200 From: Pieter de Goeje To: freebsd-hackers@freebsd.org Date: Tue, 6 Jun 2006 02:08:28 +0200 User-Agent: KMail/1.9.1 References: <8e96a0b90606041148g5674ca31r74be2e1f9c79b640@mail.gmail.com> In-Reply-To: <8e96a0b90606041148g5674ca31r74be2e1f9c79b640@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606060208.28838.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Cc: mal content Subject: Re: Strange behaviour from mkdir()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2006 01:01:08 -0000 Hi MC, On Sunday 04 June 2006 20:48, mal content wrote: > Is this expected behaviour (I'm using the mkdir utility > for the example, but the problem occurs using the system > call directly): > > # mkdir . > mkdir: .: File exists > # mkdir .. > mkdir: ..: File exists > > Now, the unusual one: > > # mkdir / > mkdir: /: Is a directory > > Shouldn't it say 'file exists'? In fact, the _only_ directory that I could find that shows this behaviour is /. (I am using 6-stable) > > The mkdir() man page doesn't say that the function can set > errno to EISDIR and yet that's what's happening here. > I did some research on it, and it seems the mkdir utility is aware of the EISDIR error. Kinda weird if you ask me, since it isn't documented. Pieter de Goeje