5 ms·
Why should an application need to be aware of the file meta data in most situations anyway? Shouldn't the OS handle the metadata unless the application specific
by sqeaky 10y ago
Why should an application need to be aware of the file meta data in most situations anyway? Shouldn't the OS handle the metadata unless the application specifically requests otherwise?
- willtim 10y agoI'm guessing the issue is that many apps use the Windows APIs badly and just recreate files rather than updating them.
- saurik 10y agoOr they use the Windows API well and purposely create new files rather than updating old ones to get atomic updates (the same way that most editors on Unix never ever update existing files and instead create new ones on which they call rename()).
- willtim 10y agoWell they obviously aren't checking for metadata / extended attributes when reading the files.
- lucaspiller 10y agoThis issue exists on Linux too :-) ext4 supports extended attributes including the creation time, but most apps blindly rename which means the metadata is lost.
- KirinDave 10y agoI'm glad someone else said it. I was biting my tongue.
- sqeaky 10y agoIn both operating systems, aren't there APIs for this?
- dom0 10y agoFor what? Creatingafilewritingtoitthenrenamingitoveranexistingfile? Or did you mean moving the metadata as well? Transferring all kinds of metadata from file A to file B is heinously non-portable across OSes and even OS releases. The specific metadata this is about isn't even available in the Win32 API, it's only part of the native API (and the kernel API ofc.)
- sqeaky 10y agoAn API for Atomic operations with files. There are APIs in windows apparently. A quick Google search reveals function like CreateDirectoryTransacted, and another quick search reveals that the Kernel leaves this kind of thing up to the filesystem. So on Linux filesystems like ZFA and BTRFS just use the normal posix file APIs and others can optionally provide other functions if they choose to. So yeah... The whole make a file and rename it thing is dirty hack. EDIT - Grammar
- poizan42 10y ago> [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using Transactional NTFS.]
- dom0 10y ago> An API for Atomic operations with files. Windows has TxF (used in Windows Update and Installer to tame the eeeenormous complexity a tiny bit; TxF and VSS also use similar mechanisms), but no other mainstream OS has anything remotely close.