Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Think of it! With VLSI we can pack 100 ENIACs in 1 sq. cm.!


devel / comp.unix.shell / How can I rename and "touch" a file in one go?

SubjectAuthor
* How can I rename and "touch" a file in one go?Ottavio Caruso
+* How can I rename and "touch" a file in one go?Janis Papanagnou
|`* How can I rename and "touch" a file in one go?Ottavio Caruso
| +- How can I rename and "touch" a file in one go?Janis Papanagnou
| +* How can I rename and "touch" a file in one go?Lew Pitcher
| |`- How can I rename and "touch" a file in one go?Lew Pitcher
| +- How can I rename and "touch" a file in one go?David W. Hodgins
| +* How can I rename and "touch" a file in one go?Kaz Kylheku
| |+* How can I rename and "touch" a file in one go?Bit Twister
| ||+- How can I rename and "touch" a file in one go?Janis Papanagnou
| ||`- How can I rename and "touch" a file in one go?Keith Thompson
| |`* How can I rename and "touch" a file in one go?Ottavio Caruso
| | `- How can I rename and "touch" a file in one go?Wayne
| +* How can I rename and "touch" a file in one go?Frank Winkler
| |+* Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file inKenny McCormack
| ||`* Bad defaults for Unix 'cp" commands (Was: How can I rename andChris Elvidge
| || +* Bad defaults for Unix 'cp" commands (Was: How can I rename andFrank Winkler
| || |`* Bad defaults for Unix 'cp" commands (Was: How can I rename andKenny McCormack
| || | +* Bad defaults for Unix 'cp" commands (Was: How can I rename andFrank Winkler
| || | |+* Google is soooo kewl! (Was: Bad defaults for Unix 'cp" commands (Was: How can I Kenny McCormack
| || | ||`- Google is soooo kewl! (Was: Bad defaults for Unix 'cp" commandsOttavio Caruso
| || | |`- Bad defaults for Unix 'cp" commands (Was: How can I rename andKenny McCormack
| || | `- Bad defaults for Unix 'cp" commands (Was: How can I rename andChris Elvidge
| || +- Bad defaults for Unix 'cp" commands (Was: How can I rename andDavid W. Hodgins
| || +- Bad defaults for Unix 'cp" commands (Was: How can I rename andKaz Kylheku
| || `* Bad defaults for Unix 'cp" commands (Was: How can I rename andKaz Kylheku
| ||  `* Bad defaults for Unix 'cp" commands (Was: How can I rename andWayne
| ||   `- Bad defaults for Unix 'cp" commands (Was: How can I rename andOttavio Caruso
| |+* How can I rename and "touch" a file in one go?Janis Papanagnou
| ||`* How can I rename and "touch" a file in one go?Keith Thompson
| || `- How can I rename and "touch" a file in one go?Janis Papanagnou
| |+* How can I rename and "touch" a file in one go?Ben Bacarisse
| ||`* How can I rename and "touch" a file in one go?Geoff Clare
| || `- How can I rename and "touch" a file in one go?Ben Bacarisse
| |+- How can I rename and "touch" a file in one go?Keith Thompson
| |`* How can I rename and "touch" a file in one go?Kaz Kylheku
| | +* How can I rename and "touch" a file in one go?Janis Papanagnou
| | |`- How can I rename and "touch" a file in one go?Kaz Kylheku
| | `- How can I rename and "touch" a file in one go?Ben Bacarisse
| +- How can I rename and "touch" a file in one go?Wayne
| +* How can I rename and "touch" a file in one go?Randal L. Schwartz
| |+* How can I rename and "touch" a file in one go?Christian Weisgerber
| ||+* How can I rename and "touch" a file in one go?Janis Papanagnou
| |||`- How can I rename and "touch" a file in one go?Dan Cross
| ||`- How can I rename and "touch" a file in one go?Kaz Kylheku
| |+- How can I rename and "touch" a file in one go?Ben Bacarisse
| |`- How can I rename and "touch" a file in one go?Dan Cross
| `* How can I rename and "touch" a file in one go?Richard Kettlewell
|  `* How can I rename and "touch" a file in one go?Kenny McCormack
|   +* How can I rename and "touch" a file in one go?Janis Papanagnou
|   |`* How can I rename and "touch" a file in one go?Kenny McCormack
|   | `* How can I rename and "touch" a file in one go?Janis Papanagnou
|   |  `* How can I rename and "touch" a file in one go?Richard Kettlewell
|   |   `* How can I rename and "touch" a file in one go?Janis Papanagnou
|   |    `- How can I rename and "touch" a file in one go?Dan Cross
|   +* How can I rename and "touch" a file in one go?Ben Bacarisse
|   |`- How can I rename and "touch" a file in one go?Dan Cross
|   `* How can I rename and "touch" a file in one go?Geoff Clare
|    +* How can I rename and "touch" a file in one go?Christian Weisgerber
|    |`* How can I rename and "touch" a file in one go?Geoff Clare
|    | +- How can I rename and "touch" a file in one go?Kenny McCormack
|    | `* How can I rename and "touch" a file in one go?Keith Thompson
|    |  +- How can I rename and "touch" a file in one go?Richard Kettlewell
|    |  `- How can I rename and "touch" a file in one go?Jim
|    `- How can I rename and "touch" a file in one go?John D Groenveld
`- How can I rename and "touch" a file in one go?Kaz Kylheku

Pages:123
How can I rename and "touch" a file in one go?

<u9at4h$2kq2g$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6428&group=comp.unix.shell#6428

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 09:01:05 +0000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <u9at4h$2kq2g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 20 Jul 2023 09:01:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c0da976d0b1891db748dff87aaad3951";
logging-data="2779216"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WXolojRjDsjk5x88FkBwqTRYr9Pk0z68="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:wKmP/npPvT6nHJNI42QQJd/NqzE=
Content-Language: en-GB
X-No-Archive: Yes
 by: Ottavio Caruso - Thu, 20 Jul 2023 09:01 UTC

I have a Bash script that renames files after being listened to:

FILE=$(ls -tr|head -n 1) # get the oldest file
aplay $FILE # where $FILE is a wav file
mv $FILE $(date +"%Y%m%d_%H%M").wav

However the resulting file doesn't get its timestamp changed, so I have to:

FILE=$(ls -tr|head -n 1
aplay $FILE
touch $FILE
mv $FILE $(date +"%Y%m%d_%H%M").wav

which is fine, but I wonder if there is a way for "mv" to update the
timestamp without using "touch".

Thanks.

--
Ottavio Caruso

Re: How can I rename and "touch" a file in one go?

<u9atuc$2l1a0$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6429&group=comp.unix.shell#6429

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 11:14:52 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u9atuc$2l1a0$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 20 Jul 2023 09:14:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a1645943171414ffab9e3db47f63ac86";
logging-data="2786624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1922WVJcP7EEPpsrWCluWU+"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:rnnMkFTQm0e0Vjejq6LHvkle5E8=
In-Reply-To: <u9at4h$2kq2g$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Thu, 20 Jul 2023 09:14 UTC

On 20.07.2023 11:01, Ottavio Caruso wrote:
> I have a Bash script that renames files after being listened to:
>
> FILE=$(ls -tr|head -n 1) # get the oldest file
> aplay $FILE # where $FILE is a wav file
> mv $FILE $(date +"%Y%m%d_%H%M").wav
>
> However the resulting file doesn't get its timestamp changed, so I have to:
>
> FILE=$(ls -tr|head -n 1
> aplay $FILE
> touch $FILE
> mv $FILE $(date +"%Y%m%d_%H%M").wav
>
>
> which is fine, but I wonder if there is a way for "mv" to update the
> timestamp without using "touch".

No, 'touch' is the command to use if you want to update time-stamps.

What you may also want to consider...
Quote all uses of $FILE.
Use 'mv -i' to prevent name clashes with your name's minute resolution.
Keep the output of 'date' in a variable and use it also for 'touch -d'.
You can also use 'stat' to get the file date(s) (access, modification,
change) directly from the file without 'date', so that you may choose
whether to use initial date of the file or the date of last playing it.

Janis

>
> Thanks.
>

Re: How can I rename and "touch" a file in one go?

<u9bfbf$2o509$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6430&group=comp.unix.shell#6430

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 14:11:59 +0000
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <u9bfbf$2o509$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 20 Jul 2023 14:11:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c0da976d0b1891db748dff87aaad3951";
logging-data="2888713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3dghtnOMH310QX61YiqrG0t5LEOkRKz4="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:G7Ua/Y3gFXOY2BiGVUQoXoYeBso=
In-Reply-To: <u9atuc$2l1a0$1@dont-email.me>
Content-Language: en-GB
X-No-Archive: Yes
 by: Ottavio Caruso - Thu, 20 Jul 2023 14:11 UTC

Am 20/07/2023 um 09:14 schrieb Janis Papanagnou:
> On 20.07.2023 11:01, Ottavio Caruso wrote:
>> I have a Bash script that renames files after being listened to:
>>
>> FILE=$(ls -tr|head -n 1) # get the oldest file
>> aplay $FILE # where $FILE is a wav file
>> mv $FILE $(date +"%Y%m%d_%H%M").wav
>>
>> However the resulting file doesn't get its timestamp changed, so I have to:
>>
>> FILE=$(ls -tr|head -n 1
>> aplay $FILE
>> touch $FILE
>> mv $FILE $(date +"%Y%m%d_%H%M").wav
>>
>>
>> which is fine, but I wonder if there is a way for "mv" to update the
>> timestamp without using "touch".
>
> No, 'touch' is the command to use if you want to update time-stamps.
>
> What you may also want to consider...
> Quote all uses of $FILE.
> Use 'mv -i' to prevent name clashes with your name's minute resolution.
> Keep the output of 'date' in a variable and use it also for 'touch -d'.
> You can also use 'stat' to get the file date(s) (access, modification,
> change) directly from the file without 'date', so that you may choose
> whether to use initial date of the file or the date of last playing it.

Thanks, but it sucks. Has this been "mv" standard behaviour from the
UNIX days? You would expect that renaming a file literally creates a new
file, hence modifying creation date.

--
Ottavio Caruso

Re: How can I rename and "touch" a file in one go?

<u9bgfd$2ocsf$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6431&group=comp.unix.shell#6431

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 16:31:09 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <u9bgfd$2ocsf$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 20 Jul 2023 14:31:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3544b878610ffa19e9fcaa3d3777340c";
logging-data="2896783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HnGHKWmWb1mk7OFlVMvwz"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:WU9S8iCSrTT0VzN4UXXP6jGzQ0U=
In-Reply-To: <u9bfbf$2o509$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Thu, 20 Jul 2023 14:31 UTC

On 20.07.2023 16:11, Ottavio Caruso wrote:
>
> [...] Has this been "mv" standard behaviour from the UNIX days? You
> would expect that renaming a file literally creates a new file, hence
> modifying creation date.

Well, as far as I am concerned we're still at least in the "Unix" days.
But yes, that's how I remember 'mv' to have always been. And note that
a 'mv' is just _renaming_ the file (i.e. changing the directory entry),
not creating a new file. At least I would expect (in the Unix world)
that a file is efficiently renamed [*] instead of being newly created.
[**] Usually I'm not very much interested when a file got renamed, but
your mileage may, vary of course.

Janis

[*] Note: at least if the file is/remains on the same file system.

[**] In earlier times it may (on MS DOS) have been differently, but
memories are faint and I just recall a lot of inefficiencies on the
DOS platform (especially with files and processes).

Re: How can I rename and "touch" a file in one go?

<u9bit4$2njve$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6432&group=comp.unix.shell#6432

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 15:12:36 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 57
Message-ID: <u9bit4$2njve$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 20 Jul 2023 15:12:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="250a78a51ff4dd5c2b4bdf0052041294";
logging-data="2871278"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++rc59FcDCCoNCCSufEv4vjNJXIHSsBi8="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:qyzhJjsDvSsdLo87C1LRnUeeXuU=
 by: Lew Pitcher - Thu, 20 Jul 2023 15:12 UTC

On Thu, 20 Jul 2023 14:11:59 +0000, Ottavio Caruso wrote:

> Am 20/07/2023 um 09:14 schrieb Janis Papanagnou:
>> On 20.07.2023 11:01, Ottavio Caruso wrote:
>>> I have a Bash script that renames files after being listened to:
>>>
>>> FILE=$(ls -tr|head -n 1) # get the oldest file
>>> aplay $FILE # where $FILE is a wav file
>>> mv $FILE $(date +"%Y%m%d_%H%M").wav
>>>
>>> However the resulting file doesn't get its timestamp changed, so I have to:
>>>
>>> FILE=$(ls -tr|head -n 1
>>> aplay $FILE
>>> touch $FILE
>>> mv $FILE $(date +"%Y%m%d_%H%M").wav
>>>
>>>
>>> which is fine, but I wonder if there is a way for "mv" to update the
>>> timestamp without using "touch".
>>
>> No, 'touch' is the command to use if you want to update time-stamps.
>>
>> What you may also want to consider...
>> Quote all uses of $FILE.
>> Use 'mv -i' to prevent name clashes with your name's minute resolution.
>> Keep the output of 'date' in a variable and use it also for 'touch -d'.
>> You can also use 'stat' to get the file date(s) (access, modification,
>> change) directly from the file without 'date', so that you may choose
>> whether to use initial date of the file or the date of last playing it.
>
> Thanks, but it sucks. Has this been "mv" standard behaviour from the
> UNIX days? You would expect that renaming a file literally creates a new
> file, hence modifying creation date.

No, under Unix, you would /NOT/ expect that mv(1) would create a new
file, nor would it modify a "creation date".

Unless moving from one filesystem to another, mv(1) just modifies the
name of the file, and leaves the inode alone. Under this scenario, there's
no "new file", just changes to one (or two) directories.

If you move a file (or directory) from one filesystem to another, mv(1)
acts like a cp(1), followed by an unlink(1). In this case, it /will/
create a new file, and a new inode for that file.

However, mv(1) /does not/ (on Unix file systems) update a "creation time".
Some, more recent, filesystems include such a timestamp, as do the Microsoft
filesystems, but traditional Unix filesystems only include three timestamps:
1) the time of last access to the file data (the "atime"),
2) the time of last modification of the file data (the "mtime"), and
3) the time of last status change (the "ctime")

HTH
--
Lew Pitcher
"In Skills We Trust"

Re: How can I rename and "touch" a file in one go?

<op.18dzm7wma3w0dxdave@hodgins.homeip.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6433&group=comp.unix.shell#6433

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 11:22:09 -0400
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <op.18dzm7wma3w0dxdave@hodgins.homeip.net>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="fa290f9b851dfb0a02e93ed143db2768";
logging-data="2915708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+m4fsVs/FqmlDTZOnr8nrvGP3AQ59fBV0="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:hRCm7VLehXbjHjIZa/JDlYhPkSA=
 by: David W. Hodgins - Thu, 20 Jul 2023 15:22 UTC

On Thu, 20 Jul 2023 10:11:59 -0400, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> Thanks, but it sucks. Has this been "mv" standard behaviour from the
> UNIX days? You would expect that renaming a file literally creates a new
> file, hence modifying creation date.

It does not create a new file unless the source and destination directories
are in different file systems.

Consider hard links, two file names pointing to the same inode. Moving one
of them has no affect on the other. The file has not been changed, just one
of the names pointing to the inode. Same logic is used when there is only one
file name.

Regards, Dave Hodgins

Re: How can I rename and "touch" a file in one go?

<20230720095654.808@kylheku.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6434&group=comp.unix.shell#6434

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 17:00:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20230720095654.808@kylheku.com>
References: <u9at4h$2kq2g$1@dont-email.me>
Injection-Date: Thu, 20 Jul 2023 17:00:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2ea12c6fbeb32cb78a2f4233d4a3c14b";
logging-data="2946899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183B+5TGneP3xNqq9UtTOmAp0WWHKKvVts="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:iEQXxI5gKFdCI03A4eKENaTTB4M=
 by: Kaz Kylheku - Thu, 20 Jul 2023 17:00 UTC

On 2023-07-20, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> which is fine, but I wonder if there is a way for "mv" to update the
> timestamp without using "touch".

At the operating system level, a rename and touch are operations on
different objects. Renaming a file operates on a directory (or two
directories). Touching a file operates on the file.

There is no locking scheme for doing that atomically: operating
on an object /and/ on the directories in which its name appears.

Even if a utility existed which touches and moves in a single
command, a program executing in parallel with that utility would
be able to observe the changes separately; it would notice that
the modification time of the file has updated, but the file
has not yet been renamed, or vice versa.

(Or amy I wrong? Is it doable in some Unix by putting a mandatory
lock on the directories involved, and the object?)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: How can I rename and "touch" a file in one go?

<20230720100110.947@kylheku.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6435&group=comp.unix.shell#6435

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 17:09:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <20230720100110.947@kylheku.com>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me>
Injection-Date: Thu, 20 Jul 2023 17:09:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2ea12c6fbeb32cb78a2f4233d4a3c14b";
logging-data="2946899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//kDL6sSRB0cFvdY/EwhhSVmFpU/UdYYQ="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:i1yaBm6C6LiBq3zoDTA3/KCmYbw=
 by: Kaz Kylheku - Thu, 20 Jul 2023 17:09 UTC

On 2023-07-20, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> Thanks, but it sucks. Has this been "mv" standard behaviour from the
> UNIX days? You would expect that renaming a file literally creates a new
> file, hence modifying creation date.

Files do not have a "creation date" in Unix, only a modification time.

Files have "creation date" in, for example, Microsoft Windows. That date
is preserved by Microsoft Windows when you rename a file.

If a system has separate creation and modification dates, it would
make a certain amount of sense to touch the modification date if
the file is renamed. You could argue for that requirement without being
automatically identified as a goofball. But if the creation date were
reset by the act of renaming, that would be pretty reprehensible.

Ideally, files should have a durable creation date that survives
even if they are moved from one system to another (possibly
a different OS).

Some file formats have that. Even if copying a JPEG from your
phone or camera to a PC destroys the creation date of the file,
the meta-data has the time and date the shot was taken.

The Git version control system tracks the time when every commit was
initially authored. That author date sticks even when a commit is
amended or cherry-picked into other branches, though the commit date is
reset to current.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: How can I rename and "touch" a file in one go?

<u9c2e5$2njve$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6436&group=comp.unix.shell#6436

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Thu, 20 Jul 2023 19:37:41 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 23
Message-ID: <u9c2e5$2njve$2@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <u9bit4$2njve$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 20 Jul 2023 19:37:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="250a78a51ff4dd5c2b4bdf0052041294";
logging-data="2871278"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19h65aBPzGRJPysQFe9aLJY81aE3TvmyWE="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:/4G/obpzjC2m95wZBrl6kGojwto=
 by: Lew Pitcher - Thu, 20 Jul 2023 19:37 UTC

On Thu, 20 Jul 2023 15:12:36 +0000, Lew Pitcher wrote:

> On Thu, 20 Jul 2023 14:11:59 +0000, Ottavio Caruso wrote:
[snip]
>> Thanks, but it sucks. Has this been "mv" standard behaviour from the
>> UNIX days? You would expect that renaming a file literally creates a new
>> file, hence modifying creation date.
>
> No, under Unix, you would /NOT/ expect that mv(1) would create a new
> file, nor would it modify a "creation date".

For what it's worth, you can read the source code for various versions
of the Unix mv(1) command. For instance, the source code for mv(1) from
Seventh Edition Unix can be found at
https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/mv.c
That version only uses the link(2) and unlink(2) syscalls, meaning
that Seventh Edition Unix mv(1) would not have been able to move files
or directories between filesystems.

HTH
--
Lew Pitcher
"In Skills We Trust"

Re: How can I rename and "touch" a file in one go?

<slrnubk7do.f9n4.BitTwister@wb.home.arpa>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6437&group=comp.unix.shell#6437

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: BitTwister@mouse-potato.com (Bit Twister)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 00:55:02 -0500
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <slrnubk7do.f9n4.BitTwister@wb.home.arpa>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <20230720100110.947@kylheku.com>
Injection-Info: dont-email.me; posting-host="43533e8b871bae4ee934cff62c444a8b";
logging-data="3301786"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wZPAjkP6MuCdl7CbmbfkF2oDIaCWuOWc="
User-Agent: slrn/pre1.0.4-6 (Linux)
Cancel-Lock: sha1:AmA/6My2E75g/BhurWXEavCZ9Dw=
 by: Bit Twister - Fri, 21 Jul 2023 05:55 UTC

On Thu, 20 Jul 2023 17:09:37 -0000 (UTC), Kaz Kylheku wrote:
> On 2023-07-20, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>> Thanks, but it sucks. Has this been "mv" standard behaviour from the
>> UNIX days? You would expect that renaming a file literally creates a new
>> file, hence modifying creation date.
>
> Files do not have a "creation date" in Unix, only a modification time.

Glad I run linux then:
$ cat /etc/release
Mageia release 9 (Cauldron) for x86_64

for ARG in w x y z ; do echo -n " -$ARG " ;\
stat --format=%$ARG /etc/profile ; done ;\
man stat | grep human-

-w 2023-03-16 20:43:32.784828906 -0500
-x 2023-07-20 03:11:22.485829606 -0500
-y 2023-01-02 12:37:29.982724141 -0600
-z 2023-03-16 20:43:32.784828906 -0500
%w time of file birth, human-readable; - if unknown
%x time of last access, human-readable
%y time of last data modification, human-readable
%z time of last status change, human-readable

$ stat --version
stat (GNU coreutils) 9.1
Copyright (C) 2022 Free Software Foundation, Inc.

Re: How can I rename and "touch" a file in one go?

<u9ddvo$35op3$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6438&group=comp.unix.shell#6438

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 10:00:55 +0200
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <u9ddvo$35op3$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <20230720100110.947@kylheku.com>
<slrnubk7do.f9n4.BitTwister@wb.home.arpa>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 08:00:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="614b1a8ac70325a27d5d9a20bf92a276";
logging-data="3334947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181zpxizhsZpaCKW4nIan4D"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:x4WC4yn4JvIJkgEpMXiznKVJZZI=
In-Reply-To: <slrnubk7do.f9n4.BitTwister@wb.home.arpa>
 by: Janis Papanagnou - Fri, 21 Jul 2023 08:00 UTC

On 21.07.2023 07:55, Bit Twister wrote:
> On Thu, 20 Jul 2023 17:09:37 -0000 (UTC), Kaz Kylheku wrote:
>> On 2023-07-20, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>>> Thanks, but it sucks. Has this been "mv" standard behaviour from the
>>> UNIX days? You would expect that renaming a file literally creates a new
>>> file, hence modifying creation date.
>>
>> Files do not have a "creation date" in Unix, only a modification time.
>
> Glad I run linux then:

I am also running Linux but get (for some system file, and as I
expected) a '-' for "creation date"

-w -
-x 2022-08-04 23:42:28.296526972 +0200
-y 2022-08-04 23:42:28.296526972 +0200
-z 2022-08-04 23:42:28.296526972 +0200
%w Time of file birth, human-readable; - if unknown
%x Time of last access, human-readable
%y Time of last modification, human-readable
%z Time of last change, human-readable

Janis

> $ cat /etc/release
> Mageia release 9 (Cauldron) for x86_64
>
> for ARG in w x y z ; do echo -n " -$ARG " ;\
> stat --format=%$ARG /etc/profile ; done ;\
> man stat | grep human-
>
> -w 2023-03-16 20:43:32.784828906 -0500
> -x 2023-07-20 03:11:22.485829606 -0500
> -y 2023-01-02 12:37:29.982724141 -0600
> -z 2023-03-16 20:43:32.784828906 -0500
> %w time of file birth, human-readable; - if unknown
> %x time of last access, human-readable
> %y time of last data modification, human-readable
> %z time of last status change, human-readable
>
> $ stat --version
> stat (GNU coreutils) 9.1
> Copyright (C) 2022 Free Software Foundation, Inc.
>

Re: How can I rename and "touch" a file in one go?

<u9dhd8$365pv$3@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6439&group=comp.unix.shell#6439

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 08:59:20 +0000
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <u9dhd8$365pv$3@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <20230720100110.947@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 08:59:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c9f3b65b4d4052157575c038b434caa8";
logging-data="3348287"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185reIbvaydJvmdCUAwqAGLaT90xb5XQI8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:dNAKESYSYvEsWXF1u1eef79i14A=
Content-Language: en-GB
In-Reply-To: <20230720100110.947@kylheku.com>
X-No-Archive: Yes
 by: Ottavio Caruso - Fri, 21 Jul 2023 08:59 UTC

Am 20/07/2023 um 17:09 schrieb Kaz Kylheku:
> Files do not have a "creation date" in Unix, only a modification time.

If that is the case, how about:

$ man ls

--time=WORD
change the default of using modification times;
access time
(-u): atime, access, use; change time (-c): ctime,
status; birth time: birth, creation;

--
Ottavio Caruso

Re: How can I rename and "touch" a file in one go?

<87bkg5ppiy.fsf@nosuchdomain.example.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6440&group=comp.unix.shell#6440

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 02:44:37 -0700
Organization: None to speak of
Lines: 47
Message-ID: <87bkg5ppiy.fsf@nosuchdomain.example.com>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <20230720100110.947@kylheku.com>
<slrnubk7do.f9n4.BitTwister@wb.home.arpa>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="2370f913b850030e0527dd0f7396627d";
logging-data="3364482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YD8WeOUVLrhEMnWtbpr4p"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:roee0YrX1CSZALPQzubaxXKOX3c=
sha1:iAzYvc1MVw+uTKc2dwmGCKDlS2c=
 by: Keith Thompson - Fri, 21 Jul 2023 09:44 UTC

Bit Twister <BitTwister@mouse-potato.com> writes:
> On Thu, 20 Jul 2023 17:09:37 -0000 (UTC), Kaz Kylheku wrote:
>> On 2023-07-20, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>>> Thanks, but it sucks. Has this been "mv" standard behaviour from the
>>> UNIX days? You would expect that renaming a file literally creates a new
>>> file, hence modifying creation date.
>>
>> Files do not have a "creation date" in Unix, only a modification time.
>
> Glad I run linux then:
> $ cat /etc/release
> Mageia release 9 (Cauldron) for x86_64
>
> for ARG in w x y z ; do echo -n " -$ARG " ;\
> stat --format=%$ARG /etc/profile ; done ;\
> man stat | grep human-
>
> -w 2023-03-16 20:43:32.784828906 -0500
> -x 2023-07-20 03:11:22.485829606 -0500
> -y 2023-01-02 12:37:29.982724141 -0600
> -z 2023-03-16 20:43:32.784828906 -0500
> %w time of file birth, human-readable; - if unknown
> %x time of last access, human-readable
> %y time of last data modification, human-readable
> %z time of last status change, human-readable
>
> $ stat --version
> stat (GNU coreutils) 9.1
> Copyright (C) 2022 Free Software Foundation, Inc.

From `info coreutils 'file timestamps'`:

Standard POSIX files have three timestamps: the access timestamp
(atime) of the last read, the modification timestamp (mtime) of
the last write, and the status change timestamp (ctime) of the
last change to the file’s meta-information. Some file systems
support a fourth time: the birth timestamp (birthtime) of when
the file was created; by definition, birthtime never changes.

So the presence of the "birth" time is a property of the file system,
not necessarily of the OS (and the coreutils "ls" and "stat" commands
are able to access it somehow).

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: How can I rename and "touch" a file in one go?

<khv4chFlvvnU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6441&group=comp.unix.shell#6441

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@f.winkler-ka.de (Frank Winkler)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 12:18:57 +0200
Lines: 17
Message-ID: <khv4chFlvvnU1@mid.individual.net>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net jKBirJcS8xCRTmyZtuUrrQZyvM2JpsTYNuDN0gveCzT92ARNJm
Cancel-Lock: sha1:rnHOFDwsB8YkRX5f/SiHJVd8Wj8= sha256:c7SMmrosc5ROVbzCaJx6YZP9yY3H9w9v4PWwAu9MAvc=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <u9bfbf$2o509$1@dont-email.me>
 by: Frank Winkler - Fri, 21 Jul 2023 10:18 UTC

On 20.07.23 16:11, Ottavio Caruso wrote:

>Thanks, but it sucks. Has this been "mv" standard behaviour from the
>UNIX days? You would expect that renaming a file literally creates a new
>file, hence modifying creation date.

As many other people already said, that assumption is wrong. And to go
one step further, IMO it rather sucks that UNIX "cp" _does_ update the
modification date unless using "-p". I never understood why it behaves
this way as the content is untouched and why B should have a different
time stamp than A after "cp A B". Even brain-dead systems don't do that.

Regards

Frank

Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<u9do4o$2hdcm$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6442&group=comp.unix.shell#6442

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)
Date: Fri, 21 Jul 2023 10:54:16 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u9do4o$2hdcm$1@news.xmission.com>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me> <u9bfbf$2o509$1@dont-email.me> <khv4chFlvvnU1@mid.individual.net>
Injection-Date: Fri, 21 Jul 2023 10:54:16 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2667926"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 21 Jul 2023 10:54 UTC

In article <khv4chFlvvnU1@mid.individual.net>,
Frank Winkler <usenet@f.winkler-ka.de> wrote:
....
>As many other people already said, that assumption is wrong. And to go
>one step further, IMO it rather sucks that UNIX "cp" _does_ update the
>modification date unless using "-p". I never understood why it behaves
>this way as the content is untouched and why B should have a different
>time stamp than A after "cp A B". Even brain-dead systems don't do that.

Yes, that's a long standing misfeature. It is one of those: They picked
the wrong default in the beginning and every Unix "copy" program, from cp
to rsync, et al, has had to do the wrong thing by default ever since. You
need a command line option (-p or -a or something like that) in order to
get the sensible behavior.

Note that "mcp" does the right thing by default. That's the only
exception to the above rule that I can think of.

--
I voted for Trump because I thought he'd make pussy grabbing legal.
I honestly don't see any other way America could be made great again.

Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<u9ds0s$383sr$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6443&group=comp.unix.shell#6443

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 13:00:26 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u9ds0s$383sr$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <khv4chFlvvnU1@mid.individual.net>
<u9do4o$2hdcm$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 12:00:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4953755b20c52f88bc0a1a34e19e5a86";
logging-data="3411867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zws51qvv0kyhMl3QfGY0GyVhM3w4UDJM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:IE2kASnEFMq6liwECKrjgKshIcY=
Content-Language: en-GB
In-Reply-To: <u9do4o$2hdcm$1@news.xmission.com>
 by: Chris Elvidge - Fri, 21 Jul 2023 12:00 UTC

On 21/07/2023 11:54, Kenny McCormack wrote:
> In article <khv4chFlvvnU1@mid.individual.net>,
> Frank Winkler <usenet@f.winkler-ka.de> wrote:
> ...
>> As many other people already said, that assumption is wrong. And to go
>> one step further, IMO it rather sucks that UNIX "cp" _does_ update the
>> modification date unless using "-p". I never understood why it behaves
>> this way as the content is untouched and why B should have a different
>> time stamp than A after "cp A B". Even brain-dead systems don't do that.

"cp A B" creates a new file 'B' so B has new modification time (unless
overidden).

"mv A B" should really be advertised as "rename A B" (unless A and B are
on different filesystems).

>
> Yes, that's a long standing misfeature. It is one of those: They picked
> the wrong default in the beginning and every Unix "copy" program, from cp
> to rsync, et al, has had to do the wrong thing by default ever since. You
> need a command line option (-p or -a or something like that) in order to
> get the sensible behavior.
>
> Note that "mcp" does the right thing by default. That's the only
> exception to the above rule that I can think of.
>
mcp : command not found - slackware and lmde5

--

Chris Elvidge, England
I AM NOT THE NEW DALAI LAMA

Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<khvaveFlvvnU2@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6444&group=comp.unix.shell#6444

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@f.winkler-ka.de (Frank Winkler)
Newsgroups: comp.unix.shell
Subject: Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 14:11:26 +0200
Lines: 16
Message-ID: <khvaveFlvvnU2@mid.individual.net>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <khv4chFlvvnU1@mid.individual.net>
<u9do4o$2hdcm$1@news.xmission.com> <u9ds0s$383sr$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net J4Ym14okQ2Y20yTZwBtNxwQL2qmwzTwcQ7AlCVbwvuge8lJzWa
Cancel-Lock: sha1:KGAAejNHABTFPnagMZaP8+io4lQ= sha256:jUHzq8IRCujO1k72JQvEWrg5m63nXpy6w6AoMRg0NmA=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <u9ds0s$383sr$1@dont-email.me>
 by: Frank Winkler - Fri, 21 Jul 2023 12:11 UTC

On 21.07.23 14:00, Chris Elvidge wrote:

>"cp A B" creates a new file 'B' so B has new modification time (unless
>overidden).

Creation, not modification.

>mcp : command not found - slackware and lmde5

I also don't know that one, neither on Solaris nor macOS nor Linux nor
whatever ;) ...

Regards

Frank

Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<u9dtdc$2hemk$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6445&group=comp.unix.shell#6445

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 12:24:12 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u9dtdc$2hemk$1@news.xmission.com>
References: <u9at4h$2kq2g$1@dont-email.me> <u9do4o$2hdcm$1@news.xmission.com> <u9ds0s$383sr$1@dont-email.me> <khvaveFlvvnU2@mid.individual.net>
Injection-Date: Fri, 21 Jul 2023 12:24:12 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2669268"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 21 Jul 2023 12:24 UTC

In article <khvaveFlvvnU2@mid.individual.net>,
Frank Winkler <usenet@f.winkler-ka.de> wrote:
>On 21.07.23 14:00, Chris Elvidge wrote:
>
> >"cp A B" creates a new file 'B' so B has new modification time (unless
> >overidden).
>
>Creation, not modification.

Yes. Everybody knows that. The point is: It is a historical misfeature.

> >mcp : command not found - slackware and lmde5
>
>I also don't know that one, neither on Solaris nor macOS nor Linux nor
>whatever ;) ...

Have neither you nor Chris heard of these wonderful pieces of software
called "package managers"? They're really cool, and you should look into
them. They are so cool - you just run them and they install new software
on your system that you didn't have before. What's even better is that
these package manager thingies *are* usually installed by default on your
Linux system(s), you don't even have to explicitly get and install them.
They just work. It is soooooooo kewl!

--
This is the GOP's problem. When you're at the beginning of the year
and you've got nine Democrats running for the nomination, maybe one or
two of them are Dennis Kucinich. When you have nine Republicans, seven
or eight of them are Michelle Bachmann.

Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<khveq2FlvvnU3@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6446&group=comp.unix.shell#6446

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@f.winkler-ka.de (Frank Winkler)
Newsgroups: comp.unix.shell
Subject: Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 15:16:50 +0200
Lines: 47
Message-ID: <khveq2FlvvnU3@mid.individual.net>
References: <u9at4h$2kq2g$1@dont-email.me> <u9do4o$2hdcm$1@news.xmission.com>
<u9ds0s$383sr$1@dont-email.me> <khvaveFlvvnU2@mid.individual.net>
<u9dtdc$2hemk$1@news.xmission.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net RYir8T1UdUVPXHCdpQh3PQWbAb4GesUheISXjIL7TCy2hxIPIg
Cancel-Lock: sha1:mwnmsvpA7WCNibaVQXa7vt1oFWs= sha256:jcVFZsUMUSrzKZ4BA0g851C3ZGDbIpGzTBS0QPOxmJE=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <u9dtdc$2hemk$1@news.xmission.com>
 by: Frank Winkler - Fri, 21 Jul 2023 13:16 UTC

On 21.07.23 14:24, Kenny McCormack wrote:

>Have neither you nor Chris heard of these wonderful pieces of software
>called "package managers"? They're really cool, and you should look into

Of course I have. But even with a package manager, I only install things
that I know of. And just as an example, MacPorts also doesn't seem to
know it:

frank@lmka-2cl377md6r:~$ which mcp
frank@lmka-2cl377md6r:~$ port search mcp
Warning: port definitions are more than two weeks old, consider updating
them by running 'port selfupdate'.
mcpp @2.7.2_6 (devel)
Alternative C/C++ preprocessor

R-MCMCpack @1.6-3_1 (R, science, math)
Markov Chain Monte Carlo (MCMC) package

R-mcmcplots @0.4.3 (R, science)
Functions for convenient plotting and viewing of MCMC output

R-MCPAN @1.1-21 (R, science, math)
Multiple contrast tests and simultaneous confidence intervals based on
normal approximation

R-ncvreg @3.14.1_1 (R, science, math)
Regularization paths for SCAD and MCP penalized regression models

wmcpuload @1.0.1_4 (sysutils, x11)
An lcd dockapp that displays the current cpuload

xdm @1.1.12 (x11)
X11 display manager with support for XDMCP, host chooser

xorg-libXdmcp @1.1.4 (x11, devel)
X.org libXdmcp

Found 8 ports.
frank@lmka-2cl377md6r:~$

I can try OpenCSW on a Solaris machine.

Regards

Frank

Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<u9e14v$38rmg$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6447&group=comp.unix.shell#6447

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 14:27:58 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <u9e14v$38rmg$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9do4o$2hdcm$1@news.xmission.com>
<u9ds0s$383sr$1@dont-email.me> <khvaveFlvvnU2@mid.individual.net>
<u9dtdc$2hemk$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 13:28:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4953755b20c52f88bc0a1a34e19e5a86";
logging-data="3436240"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18TQdQeK4YxXu7YEmQij3gdDgKm6Q5XPqs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:Jed/RJcuqkcUsFeXCUhsIWWjIOw=
In-Reply-To: <u9dtdc$2hemk$1@news.xmission.com>
Content-Language: en-GB
 by: Chris Elvidge - Fri, 21 Jul 2023 13:27 UTC

On 21/07/2023 13:24, Kenny McCormack wrote:
> In article <khvaveFlvvnU2@mid.individual.net>,
> Frank Winkler <usenet@f.winkler-ka.de> wrote:
>> On 21.07.23 14:00, Chris Elvidge wrote:
>>
>> >"cp A B" creates a new file 'B' so B has new modification time (unless
>> >overidden).
>>
>> Creation, not modification.
>
> Yes. Everybody knows that. The point is: It is a historical misfeature.
>
>> >mcp : command not found - slackware and lmde5
>>
>> I also don't know that one, neither on Solaris nor macOS nor Linux nor
>> whatever ;) ...
>
> Have neither you nor Chris heard of these wonderful pieces of software
> called "package managers"? They're really cool, and you should look into
> them. They are so cool - you just run them and they install new software
> on your system that you didn't have before. What's even better is that
> these package manager thingies *are* usually installed by default on your
> Linux system(s), you don't even have to explicitly get and install them.
> They just work. It is soooooooo kewl!
>

Slackpkg can't find it.
Neither can "apt search" nor "apt list" on LMDE5.

--

Chris Elvidge, England
I WILL NOT MESS WITH THE OPENING CREDITS

Google is soooo kewl! (Was: Bad defaults for Unix 'cp" commands (Was: How can I rename and) "touch" a file in one go?)

<u9e191$2hemk$3@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6448&group=comp.unix.shell#6448

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Google is soooo kewl! (Was: Bad defaults for Unix 'cp" commands (Was: How can I rename and)
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 13:30:09 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u9e191$2hemk$3@news.xmission.com>
References: <u9at4h$2kq2g$1@dont-email.me> <khvaveFlvvnU2@mid.individual.net> <u9dtdc$2hemk$1@news.xmission.com> <khveq2FlvvnU3@mid.individual.net>
Injection-Date: Fri, 21 Jul 2023 13:30:09 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2669268"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 21 Jul 2023 13:30 UTC

In article <khveq2FlvvnU3@mid.individual.net>,
Frank Winkler <usenet@f.winkler-ka.de> wrote:
>On 21.07.23 14:24, Kenny McCormack wrote:
>
> >Have neither you nor Chris heard of these wonderful pieces of software
> >called "package managers"? They're really cool, and you should look into
>
>Of course I have. But even with a package manager, I only install things
>that I know of. And just as an example, MacPorts also doesn't seem to
>know it:

There's also this really cool thing - called "google". You can find out
all kinds of stuff using it. It's really amazing.

Using this google thingie, you can learn about these things called "C
compilers" and "make" programs. Then you can learn about doing things
like:

./configure
make

--
Q: How much do dead batteries cost?

A: Nothing. They are free of charge.

Re: How can I rename and "touch" a file in one go?

<u9e30i$395mr$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6449&group=comp.unix.shell#6449

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 15:59:45 +0200
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <u9e30i$395mr$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <khv4chFlvvnU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 13:59:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7316e8c8f3654ed770929781ecc950ca";
logging-data="3446491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18p19OV2TtnY79wG5VbCgqM"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:RMb5UJihiARz9r93dcGCyLnVfJ8=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <khv4chFlvvnU1@mid.individual.net>
 by: Janis Papanagnou - Fri, 21 Jul 2023 13:59 UTC

On 21.07.2023 12:18, Frank Winkler wrote:
> On 20.07.23 16:11, Ottavio Caruso wrote:
>
> >Thanks, but it sucks. Has this been "mv" standard behaviour from the
> >UNIX days? You would expect that renaming a file literally creates a new
> >file, hence modifying creation date.
>
> As many other people already said, that assumption is wrong. And to go
> one step further, IMO it rather sucks that UNIX "cp" _does_ update the
> modification date unless using "-p". I never understood why it behaves
> this way as the content is untouched and why B should have a different
> time stamp than A after "cp A B". Even brain-dead systems don't do that.

I can see reasons for both interpretations, so I cannot chime in with
this heavy wording. After all the meta-data "operates" on a technical
level (as opposed to a semantical one); new data is physically created
(whether a copy or new original data) so the time stamp changes. The
system functions (man 2) used by the commands (man 1) also reflect the
meta-data changes. I suppose how people think about it depends on their
typical use.

Myself I use mostly 'cp' without option to know when the copy had been
made. If I want the same file on a different place I use 'ln' (usually
hard links). Otherwise, if I intend to change the copy anyway, the
date of the original file becomes meaningless. But sometimes I use -p,
especially as an implicit option of '-a' or an explicit 'cp -pr' in
backup or workspace or test contexts. You can have only one default.
Whether it's a "long standing misfeature" (as said elsethread) or not
lies in the eye of the beholder.

Myself I am more concerned about 'mv -i' vs. 'mv', and when using it
(and not only interactively) I got used to always type the former for
safety reasons. (Just to mention another of the basic file commands
and its [very much subjectively] "mis-featured" defaults.)

In both cases, a _simple option_ allows your preferred solution.[*]

Janis

[*] And this reminds me the pathological case where there's no short
option available; remember the 'ls --ignore-fail-on-non-empty' from
a thread one year ago? - Compared to that 'cp -p' and 'mv -i' are
trivialities.

Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch" a file in one go?)

<u9e43p$2hhmc$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6450&group=comp.unix.shell#6450

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: Bad defaults for Unix 'cp" commands (Was: How can I rename and
"touch" a file in one go?)
Date: Fri, 21 Jul 2023 14:18:33 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u9e43p$2hhmc$1@news.xmission.com>
References: <u9at4h$2kq2g$1@dont-email.me> <khvaveFlvvnU2@mid.individual.net> <u9dtdc$2hemk$1@news.xmission.com> <khveq2FlvvnU3@mid.individual.net>
Injection-Date: Fri, 21 Jul 2023 14:18:33 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2672332"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 21 Jul 2023 14:18 UTC

In article <khveq2FlvvnU3@mid.individual.net>,
Frank Winkler <usenet@f.winkler-ka.de> wrote:
>On 21.07.23 14:24, Kenny McCormack wrote:
>
> >Have neither you nor Chris heard of these wonderful pieces of software
> >called "package managers"? They're really cool, and you should look into
>
>Of course I have. But even with a package manager, I only install things
>that I know of. And just as an example, MacPorts also doesn't seem to
>know it:

BTW, just in case you're not just being deliberately obtuse, I put "mcp Linux"
into a search engine and got (inter alia):

https://www.unix.com/man-page/suse/1/mcp/

HTH

--
Elect a clown, expect a circus.

Re: Google is soooo kewl! (Was: Bad defaults for Unix 'cp" commands (Was: How can I rename and) "touch" a file in one go?)

<u9e8j6$3a99r$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6451&group=comp.unix.shell#6451

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ottavio2006-usenet2012@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: Google is soooo kewl! (Was: Bad defaults for Unix 'cp" commands
(Was: How can I rename and) "touch" a file in one go?)
Date: Fri, 21 Jul 2023 15:35:02 +0000
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <u9e8j6$3a99r$1@dont-email.me>
References: <u9at4h$2kq2g$1@dont-email.me> <khvaveFlvvnU2@mid.individual.net>
<u9dtdc$2hemk$1@news.xmission.com> <khveq2FlvvnU3@mid.individual.net>
<u9e191$2hemk$3@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 15:35:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c9f3b65b4d4052157575c038b434caa8";
logging-data="3482939"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188v+uHc34EK9HZDevHZ38WSKH34S6drd8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:d5bZulMX3p4LVqIWCy0DJPxKz+0=
X-No-Archive: Yes
In-Reply-To: <u9e191$2hemk$3@news.xmission.com>
Content-Language: en-GB
 by: Ottavio Caruso - Fri, 21 Jul 2023 15:35 UTC

Am 21/07/2023 um 13:30 schrieb Kenny McCormack:
> There's also this really cool thing - called "google". You can find out
> all kinds of stuff using it. It's really amazing.

Google is for softy-softy gen Z snowflake fembois.

Real men use Gopher on BSD 4.2.

--
Ottavio Caruso

Re: How can I rename and "touch" a file in one go?

<87lef9nrr4.fsf@bsb.me.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6452&group=comp.unix.shell#6452

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: How can I rename and "touch" a file in one go?
Date: Fri, 21 Jul 2023 17:39:27 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <87lef9nrr4.fsf@bsb.me.uk>
References: <u9at4h$2kq2g$1@dont-email.me> <u9atuc$2l1a0$1@dont-email.me>
<u9bfbf$2o509$1@dont-email.me> <khv4chFlvvnU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="4d6d411b072660d280bdd2ba4d2c5af7";
logging-data="3504331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182zaqGOv5DzcyOXlux4O8vh00SZKSfr7M="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:WmBpqZhdjJ8ioDqFPWtuR0PcwhI=
sha1:Rq73REvmzhvPlO7koLhVYpx5pXU=
X-BSB-Auth: 1.71b789687648dd9fe252.20230721173927BST.87lef9nrr4.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 21 Jul 2023 16:39 UTC

Frank Winkler <usenet@f.winkler-ka.de> writes:

> On 20.07.23 16:11, Ottavio Caruso wrote:
>
> >Thanks, but it sucks. Has this been "mv" standard behaviour from the
> >UNIX days? You would expect that renaming a file literally creates a new
> >file, hence modifying creation date.
>
> As many other people already said, that assumption is wrong. And to go one
> step further, IMO it rather sucks that UNIX "cp" _does_ update the
> modification date unless using "-p". I never understood why it behaves this
> way as the content is untouched and why B should have a different time
> stamp than A after "cp A B". Even brain-dead systems don't do that.

To some extent it comes down to the name used. No file systems that I
know of really note a modification time in the sense of the file being
actually changed; they note a "write time". After "cp A B" B is freshly
written but has (in some sense) not been modified.

--
Ben.

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor