Bug 53564 - Is there a way to increment the time for n seconds?
Is there a way to increment the time for n seconds?
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2001-09-11 14:18 EDT by hjl
Modified: 2007-04-18 12:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-09-27 11:56:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch adding -F and -B (5.40 KB, patch)
2001-09-27 10:18 EDT, Bernhard Rosenkraenzer
no flags Details | Diff

  None (edit)
Description hjl 2001-09-11 14:18:32 EDT
Is there a way to increment the time for n seconds? I am thinking something

# touch -F n foo

which will increment the time by n seconds and

# touch -B n foo

which will decrement the time by n seconds.
Comment 1 Bernhard Rosenkraenzer 2001-09-18 05:30:17 EDT
Use touch -t or touch --time=foo for now.
Adding -F and -B wouldn't be much of a problem, but it would be nonstandard 
extensions (or are they supported anywhere else?)
Comment 2 hjl 2001-09-18 11:15:31 EDT
What I want is to make a file, bar, a few seconds newer than
foo. It is used for make. I'd like to do

# touch -t foo bar
# touch -F 1 bar

so that bar is 1 second newer than foo. I don't  want to bar to
to have the current time since foo might have been updated
between it was checked out and bar was generated.
Comment 3 Bernhard Rosenkraenzer 2001-09-27 10:18:35 EDT
Created attachment 32718 [details]
Patch adding -F and -B
Comment 4 Bernhard Rosenkraenzer 2001-09-27 11:56:40 EDT
Works slightly different though:

To achieve your example, simply

touch -r foo -F 1 bar

I've added this patch in 4.1-6
Comment 5 Moritz Barsnick 2002-08-01 11:50:21 EDT

this is a nifty feature. Is there any particular reason for
dropping it in recent fileutils packages, or was it just by
accident when branching back to older releases?

(I think I have an updated patch available.)

Gru_ an bero,

Note You need to log in before you can comment on or make changes to this bug.