#81 Option to preserve the file creation + modification date in

Compatibility
open
nobody
5
2014-08-23
2012-05-11
Stefan Schnitter
No

Hi,
having many old files which require sorting by date.
I need to retain the file creation and change dates, so an option/checkbox to select this would be very helpful.

This is a common request (3489332 Add encoding option to maintain file modification time Open 2012-02-19 nobody jmcatee 5 ) and easy to implement and would maintain compatibilty,

Discussion

  • This was the description for Audacity. For LAME, a commandline option "--preserve-filedates" could be used.

    Many have Gigabytes with old wave/other audio formats to be converted.

     
  • Thomas Orgis
    Thomas Orgis
    2012-07-05

    Are we really talking about creation time? This does not exist in POSIX. There is access and modification time (as well as attribute change time). If we want to keep modification time, this sequence of shell commands would do the trick:

    mv file.mp3 file.mp3.old
    lame input.wav file.mp3
    touch -r file.mp3.old file.mp3
    rm file.mp3.old

    file.mp3 will have new contents but old mtime / atime.

    My point being: Should one really add functionality to lame to lie about what it does (modifying the output file)? Isn't that orthogonal to its purpose of encoding MPEG audio?

     
  • This doesn't sound like a feature I would add to LAME. People, who really need to have their mp3 files with the same timestamps, can run "touch -r my.wav my.mp3" afterwards and be done with it.

     
  • The majority of users has Windows, so the below commands do not work. THe files have different timstamps, so one cannot change them recursively to match. It would be very helpful, Windows frontends like Audacity would support this feature.

     
  • Thomas Orgis
    Thomas Orgis
    2012-07-06

    Well, strictly speaking, the touch command should work on Windows when you use Cygwin or Msys;-)

    But in any case it is rather trivial to add that step to the frontend application (Audacity in this case). The advantage: In Audacity, the functionality should be generic, you would be able to preserve timestamps (propagate from input files or keep the one of an existing output file) for any output format, not just MP3 via LAME.

    It would be much more powerful to have such a feature in the frontend. Also, thinking of the variant that you want to keep the time stamps of input files (re-reading the comments, I guess that is what you want) ... are we talking about using Audacity to auto-convert a large collection of WAVs (or whatever) to MP3? Does it have a batch functionality?

    If not, I would also under windows strongly recommend using a shell like Cygwin ... it's so much more fun to automate tasks. Anyhow, let's consider you use Audacity ... if you have an input file and work with it (cutting, effects), then want to export with LAME; In that case, LAME gets fed an PCM stream, not a file (I suppose) ... it has no way of knowing the timestamps of any original input file, so this feature would be impossible!

    (Disclaimer: I'm just giving my opinion here, I am not actually working on LAME. So if you feel annoyed by my persistence about not adding such functionality to LAME, don't be angry at the LAME project people;-)

     
  • There exist native Win32 ports of the touch utility, it is part of the GNU file utils.

    from the command shell:

    D:\UnixUtils\usr\local\wbin>touch --version
    touch (GNU fileutils) 3.16

    dependencies:

    ***************************| Module Dependency Tree |***************************
    * *
    * Legend: F Forwarded Module ? Missing Module 6 64-bit Module *
    * D Delay Load Module ! Invalid Module *
    * * Dynamic Module E Import/Export Mismatch or Load Failure *
    * ^ Duplicate Module *
    * *
    ********************************************************************************

    [ ] d:\unixutils\usr\local\wbin\TOUCH.EXE
    [ ] c:\windows\system32\CRTDLL.DLL
    [ ^ ] c:\windows\system32\KERNEL32.DLL
    [F^ ] c:\windows\system32\NTDLL.DLL
    [ ] c:\windows\system32\KERNEL32.DLL
    [ ] c:\windows\system32\NTDLL.DLL
    [ ^ ] c:\windows\system32\CRTDLL.DLL