Feature Request : Change Att.& Date/Time with RegExp Replace


Basically in the "Change Attributes & Times" Popup Requester - it would be nice, if one could for each of those
check-boxes set it according to some reg-exp (the sub-folders will only allow you to match something, not change it to a specific).

I know that it is possible to create scripts that will probably accomplish this, but the idea is simply, that instead
of only allowing regexp for names (rename), make regexp-replace available for Attributes and Date / Time stamps as well.

What i want to accomplish would be something like the following:
(The reasoning is, that once, I packed my wav-files with .la (lossless audio), but since .flac is now so much more supported
(even though the file size is a bit larger) i want to decode to wav, and then recode to .flac - though the flac will set
the time to the time/date of the .wav, the .la program wont set the date/time of the .wav file to the original .la file)

  • so i want to set the .wav and .flac files to their .la time/date.

This (if it had been available in the "menu") would have looked something like the following :

'/* for each file matched get the date/time /
).la --var DT=MatchedFile.GetDateTime()

'/* for each file matched set the date/time */
\1.{wav|flac} --exe=MatchedFile.SetDateTime(DT)

If this have already been covered somewhere, I didnt find it while I searched the forums. If it already exists in some form I am not aware of, please let me know where to find it, and forget this post.

On another note, i have needed a similar functionality previously, although i forgot the purpose of that, though, it was probably also something about preserving a specific date/time.

Thank you in advance.


Can't you just put the needed date in a filename when converting and then set file date with a DOS script?

Well, as i wrote, i know that you can do this by a script, by its not that simple. Also, for the sake of completeness, if one views a file, it is primarily a pointer on the hdd to a specific sequence of sectors defining the content of it. The 1.) Filename, 2.) Date/Time 3.) Attributes 4.) Etc are all Properties of the file, to describe it.

And by that anology, it is rather strange, that the system only supports modifying the filename, by regexp-replace, but neither of the other properties of the file can be changed or modified by a pattern - you can only modify each by accessing each file, and setting a specific date/time/r/w/a/x / etc instead of by a defining property or regexp - and this is the crux of my observation - that dopus atm, only allows regexps to modify the name of the file, but none of the other properties (at least to my understanding), and that, imho, should be changed s.t. all properties can be modified in the exact same way as the filename. (Here, one could modify that to include mp3 tag data, jpeg exif data, and other meta data that can be attached to a file or be included in a file (defined either by the extension, OR by its recognized file-byte-pattern at the start of the file, like e.g. Amiga Dopus 4.12 could (pattern recognition and sequences to recognize specific file types or otherwise in a file).

Best regards /eskildsen.

I'm not sure I understand what you are asking for.

Why/how would you want to use regular expressions to change the date or attributes of a file?

Do you want to do things like match all files with a date of 10:25:** and change them the dates to 11:25:** ? That seems incredibly esoteric to me.

leo, can you elaborate on this trick? There are cases when I need to extract the date from the file name and put it back in the date attributes.

Look here File name to modified date/time?

Thank you; it worked.