Search code examples
electronelectron-packager

electron-packager does not preserve file times


I am working on an app that communicates with a device and, depending on the time stamps of files stored on that device and the time stamps of the resource files, will copy new files as needed. I have noticed that, when I run electron-packager, the time stamps for ALL of the files in the generated package have the time when the packager was run. It would appear that electron-packager, rather than simply copying the files, is reading them and rewriting them in the package directory. Is there any way to make electron-packager preserve the time stamps of the source files?


Solution

  • Looking at electron-packager's docs, there does not seem to be a way to preserve timestamps.

    As an alternative, you could check the hash of the file instead to determine if the file has been modified.