Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] detox'ing files by keeping their time stamp?
Date: Mon, 19 Feb 2018 10:21:54
Message-Id: 7C98B7C3-469B-4CC4-A087-F65FF5893D19@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] detox'ing files by keeping their time stamp? by Floyd Anderson
1 > On 18 Feb 2018, at 17:47, Floyd Anderson <f.a@××××.net> wrote:
2 >>
3 >> $ cat t.sh
4 >> #!/bin/bash
5 >> TMPF=$(mktemp "/tmp/detox_wrapper.$$.XXXXXXXX")
6 >> for f in "$@"; do
7 >> touch -r "$f" "$TMPF"
8 >> detox "$f"
9 >> touch -r "$TMPF" "$f"
10 >> done
11 >> rm -f "$TMPF"
12 >
13 > If I’m not totally wrong, the second `touch` cannot work because the file that "$f" holds is renamed now. That’s what I mean earlier with iterating a list or adapt Stroller’s suggestion.
14
15 How careless of me.
16
17 A solution is to use `detox -v` and capture the output.
18
19 $ touch '1234[]'
20 $ ls '1234[]'
21 1234[]
22 $ detox -v 1234*
23 Scanning: 1234[]
24 1234[] -> 1234-
25 $
26
27 A bit untidy. Really, detox should be patched to check the date and apply it to the new file.
28
29 Stroller.

Replies

Subject Author
Re: [gentoo-user] detox'ing files by keeping their time stamp? karl@××××××××.se