!standard A.16(74/5) 21-05-28 AI12-0433-1/01 !class binding interpretation 21-05-28 !status work item 21-05-28 !status received 21-05-28 !priority Low !difficulty Easy !qualifier Omission !subject The Simple_Name of a root directory revisited !summary The Simple_Name of a root directory is a name of that directory. !question A.16 (74/5), the description of the Simple_Name function, is potentially ambiguous and could be improved: Returns the simple name portion of the file name specified by Name. The simple name of a root directory is the root itself. The exception Name_Error is propagated if the string given as Name does not allow the identification of an external file (including directories and special files). It is unclear what "the root itself" is; is it the full name of the root directory? (Not necessarily.) !recommendation (See Summary.) !wording Modify A.16(74/5): Returns the simple name portion of the file name specified by Name. The simple name of a root directory is {a name of }the root itself. The exception Name_Error is propagated if the string given as Name does not allow the identification of an external file (including directories and special files). [Author's note: We could have an AARM note here explaining that in the case where there are multiple possible names for a root directory, Simple_Name does not require any particular version to be returned. But that should go without saying.] !discussion The question reflects an incorrect assumption: there may be many full names for a particular file (including a root directory). For instance, on a case insensitive file system, any name that can be case converted to the underlying name of the file can be a name of that file. The same is true of full names. On many systems, there is a preferred full name for a file. Some file name operations will normalize the file to that name, and others are purely string operations that do not normalize anything. We do not want to adopt rules which would require normalization where it otherwise would not be used (for instance, to implement Simple_Name). An alternative definition of Simple_Name would be to require Simple_Name to return its parameter Name unchanged if Is_Root(Name) is True. But that seems unnecessarily limiting; implementations should be able to normalize names if they wish. The only requirement here is that: Is_Root(N) = Is_Root(Simple_Name(N)) and that the same root is identified by N and the result of Simple_Name(N). !ASIS No ASIS effect. !ACATS test !appendix From WG 9 review item #159 - Tucker Taft A.16 (74/5), the description of the Simple_Name function, is potentially ambiguous and could be improved: Returns the simple name portion of the file name specified by Name. The simple name of a root directory is the [root itself]{the full name of that directory}. The exception Name_Error is propagated if the string given as Name does not allow the identification of an external file (including directories and special files). I believe it was the intent that the simple name of a root directory was the full name of that directory. Simply saying "the root itself" does not unambiguously convey that. **************************************************************** A series of replies from Randy Brukardt to issue 159. There's just the one name of a root directory -- the simple name and full name of a root directory are the same thing. I think it is confusing to say that the simple name is the full name -- it makes it sound like there are multiple names here as well as making the full name something more important than any other name. I would just use a form of the original wording and say the result is "Name itself" (Name being the parameter). Maybe add an AARM note mentioning that the simple name and full name are the same thing. Perhaps we want to allow some different result in the case of a network name (such as case normalization)? [Later:] An alternative wording would be to say that "the simple name of a root directory is the name of the root itself." That is certainly the intent of the original wording. I don't think there is any intent that root names be normalized here, so I would generally expect that if Is_Root(N) is True, then Simple_Name(N) = N; whereas Full_Name(N) may do normalization (that's required in other cases). Ergo, I don't see any point in insisting on returning the FULL name of the root from Simple_Name. It just needs to be a name for which Is_Root(N) is true, and which represents the appropriate root. Of course, that's moot on Unix/Linux, since names are generally case sensitive and the main root has only one name. But that is not true on other systems (in particular Windows). ****************************************************************