Log in

View Full Version : Is this a bug?


jollye
28th August 2009, 10:49
Hi all,

I encountered what I think is a small bug and want to report it.
I am using the plugin auto-load feature i.e. I put all my plugins into the plugins directory of AviSynth so that they load automatically when I start a script.
Sometimes when I modify a plugin of mine, I want to keep the old version so I rename its extension to something else. For example, I add .old at its end so that the old version is not recognized as a dll and not loaded by AviSynth. However I noticed that if I only add one character after the dll extension it doesn't seem to be taken into account and the file is loaded as if it was named dll. I noticed that with a plugin renamed ".dll_".
It seems AviSynth only checks the first 3 chars of the extension. if they match "dll" it loads it. Or is this a wanted feature?

jollye

shoopdabloop
29th August 2009, 00:37
Most extensions are only three characters, which is probably the reason.

JohannesL
31st August 2009, 09:28
Not .avsi, though.

Gavino
31st August 2009, 09:58
The behaviour seems to be a feature of Windows.
Avisynth uses the Win functions FindFirstFile/FindNextFile to search the plugins folder. For plugins, it uses "*.dll" as the search string and it appears that this also returns any file whose extension starts with "dll" (perhaps because files with long names or extensions also have a short name for DOS compatibility).

(Open a command prompt on your plugins folder and type "dir *.dll" - you will find it lists any files with extension "dll_" as well.)

So to stop a dll from being loaded, change the extension to "_dll", for example, or add a further extension like ".old".

OTOH, .avsi can be renamed to .avsx to prevent loading, since searching for "*.avsi" only returns files with exactly that extension (because it's more than 3 chars).

stickboy
1st September 2009, 04:28
You can try disabling the Win95TruncatedExtensions registry key:
http://technet.microsoft.com/en-us/library/cc756733%28WS.10%29.aspx

Note that it only affects newly-named files, not existing files, and it requires a reboot to take effect.