Subject: standards/11278: mkdir("nonexistent/") fails ENOENT
To: None <>
From: Klaus Klein <>
List: netbsd-bugs
Date: 10/20/2000 02:07:08
>Number:         11278
>Category:       standards
>Synopsis:       mkdir("nonexistent/") fails ENOENT
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 20 02:07:00 PDT 2000
>Originator:     Klaus Klein
>Release:        today's
Frobozz Magic Standards Company

	Creating a non-existent directory using mkdir() fails ENOENT
	if the pathname passed to mkdir() has one or more trailing

	Quoting from the description of mkdir() in IEEE Std. 1003.1-90
	specification, ``The mkdir() function creates a new directory
	with name path.''

	Quoting from the definition of a Path Name, ``A path name may
	optionally containe on or more trailing slashes.''

	In other words, from the Standard's POV the path names
	"nonexistent" and "nonexistent/" are equivalent, and the
	mkdir() function must not fail for the latter while behaving
	correctly for the former.

	(This had been fixed sometime during the pre-1.4 development
	cycle but we have a regression here.)

	Invoke the mkdir() function manually.  (Utilizing NetBSD's
	mkdir utility won't work as it strips trailing slashes from
	the path name in order to work around this bug.)

	None supplied.