Bug 260871

Summary: [patch] touch(1) enhancement
Product: Base System Reporter: Jamie Landeg-Jones <jamie>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: jamie
Priority: --- Keywords: patch
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to add "-R" to touch(1) none

Description Jamie Landeg-Jones 2022-01-02 02:15:40 UTC
Created attachment 230614 [details]
patch to add "-R" to touch(1)

I'm not quite sure how you deal with "non-standard" additions to standard commands, so please be gentle!

Incidentally, I have no preference for actual implementation, this is just what I've been using for a while. Comments welcome!

Basically, touch(1) has:

-h      If the file is a symbolic link, change the times of the link itself rather than the file that the link points to.

and:

 -r      Use the access and modifications times from the specified file instead of the current time of day.

If "-r" points to a link, the link is always followed to retrieve the datetime information.

I have a program that needs to "-r" the datetime of the link itself if the file is a link.

Up to now, I've been doing a stat of the file, and then forming the date to add, but recently thought to add this option:

-R      As -r , but if the file is a symbolic link, return the times of the link itself rather than the file that the link points to.

Patch attached. Comments?
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:33:50 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 2 Jamie Landeg-Jones 2023-06-23 00:43:42 UTC
*tumbleweed*
Comment 3 Jamie Landeg-Jones 2024-04-29 11:46:31 UTC
Over 2 years. Obviously no interest.

closed.