rename updates ctime. The glibc manual says otherwise.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
glibc manual (both in the glibc included with Ubuntu 14.10 and also in upstream glibc from git on 2014-01-23) at 14.9.9 File Times says:
"Renaming a file with 'rename' affects only the attribute change time and modification time fields of the two parent directories involved, and not the times for the file being renamed."
But in practice (tested on Ubuntu 14.10) renaming a file does change its ctime. I have checked it both at the command line and also with the small program attached.
ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: libc6 2.19-10ubuntu2.2
ProcVersionSign
Uname: Linux 3.16.0-29-generic x86_64
ApportVersion: 2.14.7-0ubuntu8.1
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Jan 23 10:24:24 2015
Dependencies:
gcc-4.9-base 4.9.1-16ubuntu6
libc6 2.19-10ubuntu2.2
libgcc1 1:4.9.1-16ubuntu6
multiarch-support 2.19-10ubuntu2.2
InstallationDate: Installed on 2014-10-23 (91 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
SourcePackage: glibc
UpgradeStatus: Upgraded to utopic on 2015-01-15 (7 days ago)
glibc is not only for Linux. POSIX allows either behaviour, see
http:// pubs.opengroup. org/onlinepubs/ 009695399/ functions/ rename. html
APPLICATION USAGE
Some implementations mark for update the st_ctime field of renamed files and some do not. Applications which make use of the st_ctime field may behave differently with respect to renamed files unless they are designed to allow for either behavior.