Page 1 of 1

suppress renaming of duplicate link files

Posted: 12 Nov 2014 22:37
by avelev1
Hi all,

When I drag an internet .url shortcut file into a folder, if another .url file with the same name exists, it appends -01 to the file name. How can I turn it off to not allow a duplicate link to be dragged?

To start with in order to be true duplicate, the file content which contains the url must match too. But let's ignore that and just compare the file name regardless of the contents. BTW that is not the behavior when you drag a file from another folder. Only with links .url files which are generated on the fly.

I looked everywhere but could not find a place to suppress that in the configuration.

Please help.

Angel

Re: suppress renaming of duplicate link files

Posted: 13 Nov 2014 03:02
by bdeshi
I believe this is handled (and caused) by Windows Explorer.
the same happens when dragging or pasting files from an android mtp device.

Re: suppress renaming of duplicate link files

Posted: 14 Nov 2014 23:34
by avelev1
No, it is not.
Win Explorer spawns a "Copy File" dialog, and even if you opt to save both files it append an incremented digit in parenthesis.

duplicate file name in Win7 Explorer:

Code: Select all

C:\dir\filename.url
C:\dir\filename (1).url
C:\dir\filename (#).url

XY automatically appends a 2 digit string. No dialog whether to overwrite or cancel:

Code: Select all

C:\dir\filename.url
C:\dir\filename-01.url
C:\dir\filename-##.url
I want to suppress the XY auto renaming, so that it will be similar to the Win7 Explorer.

I noticed that this only happens with .url files. I guess Microsoft calls them favorite files. In fact they are just .ini files with a .url extension. They have only one section:

Code: Select all

[InternetShortcut]
URL=http://en.wikipedia.org
Sometimes they also have an IconFile= entry in the same section, but not always. Anyway, for naming conflict, the file system is not concerned with the file contents, just the file name.

This behavior is very annoying in a scenario where a folder has thousands of such links.

Angel

Re: suppress renaming of duplicate link files

Posted: 15 Nov 2014 17:03
by admin
I don't really understand what is so annoying about the current behavior.

Re: suppress renaming of duplicate link files

Posted: 16 Nov 2014 11:57
by avelev1
I have a whole catalog/db set up. Many external executables and XY scripts add entries inside the file, and tags, labels and comments in XY. There are thousands of such .url files, scattered in several drives in different folders. All of that catalog logic goes haywire by the XY auto-renaming.

To clean up by search for "-01.url", "-02.url" etc. takes time and sometimes erases good data if the auto-renamed file has already been tagged/labeled/commented inadvertently, or the contents have added new key/value entries, which are not visible unless the file is opened for edit.

The problem comes from the fact that it is not copying but creation of a new file. As usual the Win7 Explorer dialog is mistitled "Copy File". There is no copying whatsoever. Firefox & Chrome drag-n-drop create a ".url" file (inside it's an .INI file). IE9+ drag-n-drop creates a ".website" file (still .INI inside, but has more sections). But they are all NEW FILES.
I don't really understand what is so annoying about the current behavior.
The fact that you answered my question with a question makes me believe that there is no fix. Then this post becomes a wish/suggestion. What I'm really looking for is a config of the auto-renaming. The config logic ought to be per file type. For example, for one file type I may want to use a different renaming pattern, different suffix, like Win 7 Explorer " (#).website"; or pack some other characters into the suffix or a date-stamp suffix instead of an auto-incrementing digit; or a prefix instead of suffix for some bulk operation; or turn off auto-renaming for that file type altogether, as for the .url file type.

For example I wrote several utilities that create text files I intentionally use different auto-renaming pattern which shows me which utility was used to generate the file...

Thanks for looking into this.

Angel

Re: suppress renaming of duplicate link files

Posted: 16 Nov 2014 15:09
by admin
To me it sounds good and natural that dropping a link to an (newly created) URL file does not overwrite any existing file. I don't think many users would prefer an overwrite. Making it optional or pop a prompt would be a posibility, but low prio at the moment I'm afraid.

Re: suppress renaming of duplicate link files

Posted: 16 Nov 2014 17:08
by avelev1
For most scenarios, you are right, it's natural. What you pride in is the incredible flexibility of XY.

Can you think of a script that would cause an alert to popup (only for .url files) and prevent the creation of the new file?

Maybe only for a certain folder specified in the script? I can try to drop only in that folder.

Angel

Re: suppress renaming of duplicate link files

Posted: 16 Nov 2014 17:28
by admin
No, a script cannot help here.

Re: suppress renaming of duplicate link files

Posted: 18 Feb 2019 17:20
by admin
Fixed in v19.60.0110. :cup: :whistle: