Only compare file name not extension

General Discussion in English
Post Reply
uksamo
Posts: 4
Joined: Thu Oct 14, 2021 11:03 am

Only compare file name not extension

Post by uksamo »

Hi, I'm currently using Syncovery 8.61, I'm looking for a way to mirror files by comparing file names only, with no comparison of file extension, sizes, or dates etc. I've looked through the options of my current version but unable to find a way to compare just file name, is this currently possible or possible in the latest version?

Reason: I have a photos folder full of raw files and another full of JPG files, I'd like to keep both in sync. Both folders contain the same folder structure, after culling the photos within my JPG folder I'd like to run a Syncovery profile to automatically delete the associated RAW file. I don't want any files to copy from source to destination or vice versa, but move detection would also be great, e.g. I move the JPG from the camera roll folder to an album folder, I'd like the RAW to move respectively. Each of my files are uniquely named, so no 2 photos in different folders would have the same name. Would this setup be possible to create in Syncovery?

Many thanks,
Samo

tobias
Posts: 717
Joined: Tue Mar 31, 2020 7:37 pm

Re: Only compare file name not extension

Post by tobias »

Yes, with a short PascalScript, I will post it here soon.

tobias
Posts: 717
Joined: Tue Mar 31, 2020 7:37 pm

Re: Only compare file name not extension

Post by tobias »

OK, the moving requirement makes it a bit more difficult. It will be possible with the next Syncovery version (9.39g).

tobias
Posts: 717
Joined: Tue Mar 31, 2020 7:37 pm

Re: Only compare file name not extension

Post by tobias »

Hello,
the new version 9.39g should be able to fulfill the requirement.

The profile needs to be a one-way Exact Mirror job from the JPG to the RAW side. JPG must be left, RAW right in the profile.

Under Files->More in the profile, please choose:
X Never Replace Any Files
X Never Add Any Files

Under Comparison, please choose:
X Ignore Timestamp Altogether

Under Job->PascalScript, please paste the following script, after adjusting the .raw filename extension in line one of the script to the one that you use.

This will not work if you have multiple different raw filename extensions.

Also, please run the job manually only (at first), so you can verify that the proposed actions make sense.

Code: Select all

const cRawFileExt='.raw';
      cJPEGFileExt='.jpg';

function OnReplaceFilenameLeftToRight(const FileName: UnicodeString;
        const isFolder: Boolean):UnicodeString;
begin
  if isFolder then
     Result:=FileName
  else
     Result:=ChangeFileExt(FileName,cRawFileExt);
  end;

function OnReplaceFilenameRightToLeft(const FileName: UnicodeString;
        const isFolder: Boolean):UnicodeString;
begin
  if isFolder then
     Result:=FileName
  else
     Result:=ChangeFileExt(FileName,cJPEGFileExt);
  end;

function OnGetProfilePathBeforeListing(const isRightSide:Boolean;
        var Path,UserName,Password:UnicodeString;
        var AuthKey,AuthKeyPassword:AnsiString;
        var Port:Integer):Boolean;
begin
  IgnoreFileSizes:=true;
  Result:=true;
  end;

tobias
Posts: 717
Joined: Tue Mar 31, 2020 7:37 pm

Re: Only compare file name not extension

Post by tobias »

Hello,
v9.39g is now officially available on our web site.

Post Reply