WinSCP doesn't check hardlink target date when synchronizing

Advertisement

ricardo37
Guest

WinSCP doesn't check hardlink target date when synchronizing

I am synchronizing a directory in Windows 7 against a web server running on Linux. In Windows 7 I use hard links to point to some files outside the web directory. WinSCP correctly follows these hard links and copies the target files up to the server. But on subsequent synchronizations, WinSCP doesn't recognize that the local hard link target and the remote copy of it are already synchronized. Instead WinSCP constantly offers to re-copy the hard link target up to the server. Is there are way to get WinSCP to recognize that the local and remote files are already synchronized (i.e. to compare timestamps of the remote file and the hard link target, rather than of the remote file and the hard link itself)?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: WinSCP doesn't check hardlink target date when synchronizing

I believe that hardlinks have the same timestamp as the file they point to. Or rather all hardlinks of the same file are equal.

Reply with quote

ricardo37
Guest

Sorry, a mistake in terminology. I meant a Windows symlink as opposed to a Windows shortcut. And I checked; the symlinks all definitely have different timestamps than the targets to which they point. So I rephrase my question: is there any way to get WinSCP sychronizations to check the date of the target rather than of the symlink itsef?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

ricardo37 wrote:

Sorry, a mistake in terminology. I meant a Windows symlink as opposed to a Windows shortcut. And I checked; the symlinks all definitely have different timestamps than the targets to which they point. So I rephrase my question: is there any way to get WinSCP sychronizations to check the date of the target rather than of the symlink itsef?
I do not believe Windows shortcuts are intended for tasks like that.

Reply with quote

sgakagiz
Guest

Symlinks in windows

Hello Martin, he's not talking about a *.lnk file. Rather he's saying that windows 2000 and up has supported an implementation of unix's symlinks, and instead called them hard links. A program called junction link magic (explained here) can implement them much more easily than the command line. To download the program for your testing, you can find it at here or do a google search for it.

About the hard links:
In the file listing they show up with icons looking like shortcuts (with a green arrow in my case) except that you can browse through them like normal folders.

In WinSCP this is not noticed and these hard links look like a regular folder in WinSCP. However, he's saying that winSCP seems to assume that the files that you access through the hard link are not being picked up with the correct date. I've not noticed this myself, but I thought I'd clarify.

I'd appreciate if the icons for hard links were different, like the icon for a symlink on a remote server. In a command prompt such hard links are listed as '<junction>' in case that helps you with your testing

Reply with quote

Advertisement

You can post new topics in this forum