bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bugs #10952] find lacks support for POSIX -L and -H options


From: James Youngman
Subject: [bugs #10952] find lacks support for POSIX -L and -H options
Date: Thu, 11 Nov 2004 16:17:05 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Epiphany/1.2.9

This mail is an automated notification from the bugs tracker
 of the project: findutils.

/**************************************************************************/
[bugs #10952] Latest Modifications:

Changes by: 
                James Youngman <address@hidden>
'Date: 
                Thu 11/11/04 at 21:10 (GMT)

------------------ Additional Follow-up Comments ----------------------------
I have now implemented this as specified in the POSIX standard, I believe.   
This includes a change in functionality.   Up to now, symlinks specified as 
arguments (e.g. to -newer) were not dereferenced unless they came after 
-follow.  With this change they will always be dereferenced (since -H makes an 
exception for items on the command line)






/**************************************************************************/
[bugs #10952] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10952>
Project: findutils
Submitted by: Geoff Clare
On: Tue 11/09/04 at 11:50

Category:  find
Severity:  5 - Average
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Originator Name:  
Originator Email:  
Status:  Open
Release:  4.2.4
Fixed Release:  None


Summary:  find lacks support for POSIX -L and -H options

Original Submission:  The current POSIX standard specifies -L and -H options 
for find, to control handling of symbolic links.

For now I imagine you will just want to document the omission, as you have done 
for "-exec command {} +".  It would be good if support could be added in a 
later release.  The command line argument parsing will need to change (these 
are "real" options that come before the pathnames to be searched, and the "--" 
delimiter will also need to be supported).  Once that is done, supporting -L 
would be trivial (just set the dereference and xstat globals as for -follow), 
but supporting -H would need more work.  Note that these options override each 
other, e.g. -H -L is equivalent to just -L, and -LH is equivalent to -H.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Thu 11/11/04 at 21:10         By: James Youngman <jay>
I have now implemented this as specified in the POSIX standard, I believe.   
This includes a change in functionality.   Up to now, symlinks specified as 
arguments (e.g. to -newer) were not dereferenced unless they came after 
-follow.  With this change they will always be dereferenced (since -H makes an 
exception for items on the command line)

-------------------------------------------------------
Date: Thu 11/11/04 at 15:13         By: Geoff Clare <geoffclare>
Regarding "--", yes you are right.  The point is to be able to use e.g. "find 
-- -L -print" to search a directory called -L.

Your description of how to handle -H seems right as far as the treatment of 
dangling symlinks goes, but it sounds like you missed the significance of the 
words "on the command line" in POSIX.  With -H, only symlinks specified on the 
command line are followed; symlinks encountered when reading directories are 
not followed.  (With -L, all symlinks are followed.)

-------------------------------------------------------
Date: Wed 11/10/04 at 23:31         By: James Youngman <jay>
Thanks for this.  Re-reading the POSIX spec I can't see for sure how "--" 
should be interpreted.  Should I interpret anything following the first 
occurrence of "--" as being the first path argument?

I believe that we can implement -H by writing a special function hstat() which 
first tries stat() and then calls lstat() iff the stat() call fails for any 
reason.  We then just point xstat at hstat() to implement -H.  Or did I miss a 
subtlety?












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10952>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]