Touch files (update timestamp)

A few months ago my fileserver fell over and I had to move the disks into a new machine. I didn't really pay attention and didn't realise the internal clock was significantly wrong so all files I've modified since the move is dated in the year 2000.

Does directory opus have a command the update the modified timestamp on a file? If they were dated today it would be better than dated 7 years ago so I was going to search for all old files and touch them.

It's a linux fileserver and I'm betting there is an easy way to do it from the command line, but I don't know linux that well and thought it would be just as easy if I could do it from DO.

Nevermind, I spotted the "Set Attributes" button :slight_smile:

Rather than use the SetAttr button it would be easier in this case to setup a new button with the following function:

SetAttr MODIFIED=now

This will set the modified date to now for all selected files without having to navigate any dialogs.

This is an old thread, but for those of us, like me, who searched for this, as of version 12.6 it's now under Properties (toolbar drop list)|Touch Modified Date.

You can also timeshift using the metadata panel (e.g. add 10 years to the existing timestamp) rather than just set everything to the current time.

I've worked out how to add this to the context menu for all files and folders (via Settings -> File Types) - but I am wondering how to modify this command to be recursive - i.e. to get it to 'touch' all files/folders under the currently selected folder. Is this possible?

To answer my own question, it looks like

SetAttr MODIFIED=now RECURSE

Makes it recursive.

I don't always want the timestamp change to be recursive, so I use

@keydown:none
SetAttr MODIFIED=now
@keydown:any
SetAttr MODIFIED=now RECURSE

That's a good idea. So I guess @keydown:any means ctrl/alt/shift etc would all make it recurse, huh?

Exactly. I used any, because I find I might already be holding ctrl or shift depending on how I selected the files in the first place.

Right, I am doing the same now, except since I usually do want it to recurse, I've made it so the modifier stops the recursion...

Thanks for the tip!

I use @keydown on several buttons; very flexible!

From the manual: