Batch Conversion: copy original file dates


is the forum or the Wiki the method to submit feature requests?
I cannot create an account there, so I hope it’s ok to post here.

THe batch conversion is very useful for me, with good default for converting form WAV to MP3.
I need to retain the file creation and change dates, so an option/checkbox to select this would be very helpful.

I don’t think that’s up to Audacity. The operating system creates those dates any time a file is created.

Using wxFileName::GetTimes and wxFileName::SetTimes Audacity could theoretically copy the file creation and last access/modification times of the original file to the MP3 file. But the real problem is that MP3 files are not created by Audacity at all, but by the external LAME encoder, that has no such functionality, so Corvinian may please send the feature request to the LAME mailing list, otherwise the Audacity developers probably will not be able to implement this feature in Audacity.

  • edgar


I created a ticket for a feature request, but even after “pushing” once, there’s no action
on ticket status:

But Audacity checks the return value of the LAME commandline/library, so this optional
task to “clone/copy the original file dates” could be implemented at this point in Audacity.

A reply to my feature request at LAME-dev:

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;-)

Date: 2012-07-05 06:44

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.

Date: 2012-07-03 03:14

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.

Feature Requests item #3525781, was opened at 2012-05-11 01:44
Message generated for change (Comment added) made by robert
You can respond by visiting:

Summary: Option to preserve the file creation + modification date in

Initial Comment:
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,

I’m not sure that it would make much sense for the vast majority of Audacity users as Audacity is intended to be an audio editing program rather than a batch converter. The Exported files from Audacity are new files, and would normally be different from the original imported files (for compressed formats they will always be different), so I think that an option to put the “wrong” file creation date would cause more confusion than good. Audacity is not a particularly good program for batch conversion as it works internally in raw 32-bit float format irrespective of the input format. It is also quite slow as a batch converter. Is there no dedicated batch conversion program available that will do what you want?

I tested several and none of those supports this.

I’ve had a look on Google and arrived at the same conclusion.

Another possibility could be to find a command line program that can read and write the file creation data, and write a batch script to run that application in conjunction with a command line format converter.
SoX is a command line program able to do the format conversion.
I think that FileTouch (I’ve not used it) should be able to set the date.
There’s a post here about reading the file creation date from a script

Sorry, but SoX can’t create MP3 files, at least not by default (for the same reason as Audacity). You need to have a SoX version with LAME support compiled-in. But in this case it would be faster to use the LAME command-line encoder directly.

  • Read the original file date ans store it in a shell variable.
  • Convert the WAV file to MP3 via LAME.
  • Change the date of the MP3 file to the date from the shell variable.
  • edgar

I think that there are Windows binaries available that have MP3 support built in. Linux versions generally don’t unless you compile it yourself, but yes, you could use LAME directly.