View Issue Details

IDProjectCategoryView StatusLast Update
00010231003.1(2013)/Issue7+TC1Shell and Utilitiespublic2024-06-11 08:58
ReporterClausecker Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameRobert Clausecker
Organization
User Reference
Sectionls
Page Number2888–2897
Line Number95140–95557
Interp StatusApproved
Final Accepted TextSee 0001023:0003494.
Summary0001023: Behaviour of ls -R without -a under presence of directories beginning with a dot
DescriptionIEEE 1003.1, 2013 Edition specifies the that "Filenames beginning with a <period> (’.’) and any associated information shall not be written out unless explicitly referenced, the −A or −a option is supplied, or an implementation-defined condition causes them to be written." Furthermore the -R option is specified as "Recursively list subdirectories encountered. When a symbolic link to a directory is encountered, the directory shall not be recursively listed unless the −L option is specified. The use of −R with −d or −f produces unspecified results."

Different POSIX certified systems seem to understand the meaning of "encountered" with respect to directory names differently. The first interpretation I found is that directories omitted from printing because their name begins with a dot are also omitted from recursive listing unless -a or -A is supplied. This behaviour can be found on Solaris and HP-UX. The second interpretation is that all subdirectories are always listed, including those with names beginning with a dot, regardless of whether they are listed or not. This behaviour can be found on AIX.
Desired ActionClarify the behaviour of ls -R with respect to directories whose name begins with a dot.

Preferably, to the paragraph beginning in line 95191:

    -R Recursively list subdirectories encountered. When a symbolic
       link to a directory is encountered, the directory shall not be
       recursively listed unless the −L option is specified. The use of
       −R with −d or −f produces unspecified results.

add the sentence

    When -R is used without -a or -A, it is unspecified whether
    subdirectories with filenames beginning with a <period> ('.')
    are recursively listed.
Tagsissue8

Activities

Don Cragun

2016-11-17 16:55

manager   bugnote:0003494

Interpretation response
------------------------

The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this.
This is being referred to the sponsor.

Rationale:
-------------
It seems that all implementations of ls, but one, have excluded hidden directories when using ls -R without -A and without -a. The standard developers believe that this is the correct or intended behavior. However, the standard did not clearly specify this behavior.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Change:
    
    
Recursively list subdirectories encountered.


to:

    
Recursively list subdirectories encountered. Subdirectories with filenames beginning with a <period> ('.') shall be recursively listed if and only if the subdirectory name was included in the filenames listed for the containing directory.

ajosey

2016-12-15 18:08

manager   bugnote:0003516

Interpretation proposed: 15 Dec 2016

ajosey

2017-01-18 15:22

manager   bugnote:0003546

Interpretation Approved: 18 Jan 2017

Issue History

Date Modified Username Field Change
2016-01-11 18:55 Clausecker New Issue
2016-01-11 18:55 Clausecker Name => Robert Clausecker
2016-01-11 18:55 Clausecker Section => ls
2016-01-11 18:55 Clausecker Page Number => 2888–2897
2016-01-11 18:55 Clausecker Line Number => 95140–95557
2016-11-17 16:55 Don Cragun Note Added: 0003494
2016-11-17 16:56 Don Cragun Interp Status => Pending
2016-11-17 16:56 Don Cragun Final Accepted Text => See 0001023:0003494.
2016-11-17 16:56 Don Cragun Status New => Interpretation Required
2016-11-17 16:56 Don Cragun Resolution Open => Accepted As Marked
2016-11-17 16:56 Don Cragun Tag Attached: issue8
2016-12-15 18:08 ajosey Interp Status Pending => Proposed
2016-12-15 18:08 ajosey Note Added: 0003516
2017-01-18 15:22 ajosey Interp Status Proposed => Approved
2017-01-18 15:22 ajosey Note Added: 0003546
2020-04-14 15:03 geoffclare Status Interpretation Required => Applied
2024-06-11 08:58 agadmin Status Applied => Closed