[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why two `touch`es running back-to-back generate files with the same
From: |
Eric Blake |
Subject: |
Re: Why two `touch`es running back-to-back generate files with the same time? |
Date: |
Thu, 09 Apr 2015 16:43:31 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 04/09/2015 03:56 PM, Peng Yu wrote:
> Hi, See below for the output. I have Mac OS X 10.9.5.
>
> /tmp$ touch a; touch b
In many distributions, /tmp is mounted as a different type of
filesystem, such as tempfs, and backed solely by memory not disk. As
part of that implementation, the designers did not think it was
important to have fine-grained timestamps for that filesystem.
> Access: 2015-04-09 16:47:03.000000000 -0500
> Modify: 2015-04-09 16:47:03.000000000 -0500
> Change: 2015-04-09 16:47:03.000000000 -0500
> Birth: 2015-04-09 16:47:03.000000000 -0500
Just looking at the timestamps, it is fairly obvious that the filesystem
you are testing on has only 1-second resolution (no sub-second
resolution), so any series of actions that all complete within the same
one-second window will create timestamps that round to that same second.
(It's worse on FAT filesystems, which have a 2-second resolution).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature