Bug 260871 - [patch] touch(1) enhancement
Summary: [patch] touch(1) enhancement
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2022-01-02 02:15 UTC by Jamie Landeg-Jones
Modified: 2024-04-29 11:46 UTC (History)
1 user (show)

See Also:


Attachments
patch to add "-R" to touch(1) (2.14 KB, patch)
2022-01-02 02:15 UTC, Jamie Landeg-Jones
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.