Linux: Creation Time changed to modification time in file system yet Calc properties show it correctly!

I am using LibreOffice Calc on a Linux OpenSUSE Tumbleweed system (Btrfs filesystem)
After saving the file, the filesystem shows the creation time is changed to the current modification time. This is clearly incorrect and not expected behaviour.
Checking the LibreOffice properties panel, the creation time is actually maintained correctly as the date & time that the file was originally created. This is strange since I understood from previous questions that the LO properties were populated from the underlying system i.e via the OS accessing the filesystem metadata.
After searching this site I found an old but similar problem described for the Windows OS:

https://bugs.documentfoundation.org/show_bug.cgi?id=119238

So could it be that the lock file is being used as the modified file when changes are written out thus destroying the original filesystem creation time and taking that of the lock file? If so, then somehow, LO is keeping the correct creation time internally to correctly populate the properties tab!

Maintaining the correct file creation time visible in the OS/filesystem i.e. without opening it in LO, is important to me, so I would be grateful for any advice, enlightenment, fix or workaround.
Thanks in advance.

PS: This is my first post in this community and I believe I’ve understood and followed all guidelines, but apologies in advance if not.

My Environment:
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 480(Build:1)
CPU threads: 16; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

1 Like

Lock file is irrelevant here.
It’s unclear where could “I understood from previous questions that the LO properties were populated from the underlying system” come from (you forgot to link to the source); the creation time is stored independently of the filesystem time, inside the ODF package - se meta.xml:

<meta:creation-date>2025-01-08T18:22:43.474000000</meta:creation-date>

The reason why the filesystem creation time changes is because we create a new file, save to it, then remove the original, and rename the new file to the old name - all to improve reliability.

Thanks Mike. This makes perfect sense and is actually my preferred behaviour not relying on the underlying file system (Many applications use this method of writing new & renaming- thus losing the real creation date).
I came across this previous understanding while I was using LO in a Windows environment and unfortunately can no longer find the original source of my (mis)understanding! However, I’ve just tried LO-calc on a Windows system and the NTFS file creation date does seem to be preserved. So is the LO behaviour of writing a new file and renaming it consistent across Linux & Windows systems? (If yes, then my observation may likely be a quirk of the different file systems).

I implemented that Windows-specific behavior in tdf#119238, exactly to address your problem of not keeping original file identity. However, it uses a system-specific functionality, and so is not available on other platforms.

Just to clarify: on Windows, we also do the same sequence of “write to new file, rename to old name”, so it’s consistent across platforms. What’s system-specific is the call to a function that exists in WinAPI, that renames the updated file over the existing file, keeping the old file properties.