suppress renaming of duplicate link files

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
avelev1
Posts: 4
Joined: 12 Nov 2014 22:23

suppress renaming of duplicate link files

Post 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

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: suppress renaming of duplicate link files

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

avelev1
Posts: 4
Joined: 12 Nov 2014 22:23

Re: suppress renaming of duplicate link files

Post 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

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: suppress renaming of duplicate link files

Post by admin »

I don't really understand what is so annoying about the current behavior.

avelev1
Posts: 4
Joined: 12 Nov 2014 22:23

Re: suppress renaming of duplicate link files

Post 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

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: suppress renaming of duplicate link files

Post 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.

avelev1
Posts: 4
Joined: 12 Nov 2014 22:23

Re: suppress renaming of duplicate link files

Post 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

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: suppress renaming of duplicate link files

Post by admin »

No, a script cannot help here.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: suppress renaming of duplicate link files

Post by admin »

Fixed in v19.60.0110. :cup: :whistle:

Post Reply