Multi Commander > Support and Feedback

How to touch (copy only timestamps) of files to the other side?

(1/1)

pstein:
Assume I have two folders trees. The first on the left pane and the second on the right pane.
The content of all the files is the same but some of the files differ in their timestamp.

How can I mark e.g. 27 out of 231  files on the left pane and tell MC to copy (only) the timestamp of the corresponding file from the other side?

Thank you
Peter

Jungle:
One of the ways is to use MultiScript. E.g. the following script changes destination files last write time to the one of the source files.

--- Code: ---@var $src_path = GetSourcePath();
@var $dst_path = GetTargetPath();

if ( $src_path == $dst_path )
{
  return -1;
}

@var $src_sel = GetSourceSelectedFileNames();
@var $n;
@var $src_file;
@var $dst_file;
@var $time;

for ( $n = 0; $n < arrayCount( $src_sel ); $n++ )
{
  $src_file = $src_path ^ $src_sel[ $n ];
  if ( IsFolder( $src_file ) )
  {
    continue;
  }

  $dst_file = $dst_path ^ $src_sel[ $n ];

  if ( FileExists( $dst_file ) )
  {
    $time = GetFileTime( $src_file );
    SetFileTime( $dst_file, $time );
  }
}
--- End code ---
But this script works for manually selected files within two folders. It's not much harder to automatically find all mismatching files as long as two folders are compared. But if you want to sync whole folders structure it would require [significantly] more work.

Mathias (Author):
In the Edit menu you got many Compare and select functions.. and you also have a advanced option .
In the advanced you can compare by time.

Navigation

[0] Message Index

Go to full version