1357: LFN is broken

Discussion related to "Everything" 1.5 Alpha.
Post Reply
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

1357: LFN is broken

Post by therube »

1357: LFN is broken


"LFN" is broken ...
"LFN" is "broken" - in Everything, when shell_execute_short_parameters=1
([aside from Everything] "LFN" is broken ... in general, in everything, everywhere
& i'm sure even if LFN support is enabled in Win10/11)


thinking it must have broken when LFN support for custom_open_command01 was added?
ah, it depends on, Config: shell_execute_short_parameters=1
(& heh, any number of other factors!)


1354 "worked"
1355 brought Custom Commands
1356 added LFN support to Custom Commands (via Config: shell_execute_short_parameters= preference)


"worked".
nothing works "everywhere", with all programs
1354 "worked" with "most" everything, in "most" manners (double-click, Open With, SendTo, ...)


i take it that there is a difference between what which
a $exec("%1") does, & what an exec: shellexecute does ?
must be,
$exec sends %1 parameter which $exec executes on, directly, so capabilites (or lack thereof)
of $exec [program] determine what happens
where
exec: shellexecute, does what, a $exec() to shell, with "shell" being "DOS" [CMD],
so "DOS" determines what/how parameters are then passed to the called program
(i ran into differences there, not long ago, no?)


so "something" broke with $exec("LFN") when CC with LFN support was added,
along with setting, Config: shell_execute_short_parameters=1

additionally, various programs handle LFN (or not) differently
like IrfanView simply appears to not handle LFN - at all ?

so... as it is now, LFN can work in $exec(%1) or in Custom Command, but not both,
presently


Custom Commands like:
Config: custom_open_command01=$exec("C:\BIN\XXhash64.BAT" %*)
Config: custom_open_command02=$exec("C:\BIN\i_view32.exe" %* /thumbs)
Config: custom_open_command03=$exec("C:\DEV\WinMerge\WinMergeU.exe" %*)
Config: custom_open_command04=$exec("C:\BIN\I_View-THUMBS.bat" %*)
Config: custom_open_command05=$exec("C:\WLIB\PLAYERS\mpv.net\mpvnet.exe" %*)

Default "commands" like (aka "registered" programs [filetypes] for):
png: IrfanView
mp4: MPLayer
txt: notepad

Open With like:
png: Paint
mp4: MPLayer, mpv.net, MPC-BE, MPC-HE
txt: win32pad, Vim (also has its' own context-menu entry), wordpad

SendTo like:
hash programs, Everything -rename, rename programs, diff / merge programs

Search (term):
path:len:>260 (should suffice)

Then:
double-click on said file, or use Custom Command (or Open With or SendTo) to open file

Result:
varies, potentially greatly, heh


you might get something like:
- Everything: The filename or extension is too long (message from Everything)
or a particular program may itself report an error:
- Irfanview:
- "C:\out\Z\254LFN ...(~250 more chars here)... LFN254.png : Can't read file header !
- Unknown file format, empty/damaged file or file not found"


DOS [CMD] when given a SFN, looks to expand that into 2 parts; path + name, where the
path-part remains a SFN, & the name-part which is expanded to its' LFN name, so very
possible (actually, it /has/ to be, doesn't it - if the name-part is already at its'
max.len of 255) what "DOS" passes on to the called program will still be a LFN
(& in the case of IrfanView, it can't handle that)



example SFN:
C:\out\Z\254LFN~1.PNG

DIR sfn
= OK, prints "Directory of C:\out\Z"
followed by the directory entry, with the full (lfn) name-part

DIR /B sfn
= OK, prints the full (long) file name-part (only)

DIR /X sfn
= OK, prints "Directory of C:\out\Z"
followed by the directory entry, with the 8.3 (short) name-part,
followed by the full (lfn) name-part


START sfn
= FAIL
(that kind of says that /this, START sfn/ is on IrfanView)


(with a pic: file & IrfanView) Everything shows:
Directory 'C:\out\Z' (a SFN as it happens to be)
File 'C:\out\Z\254LFN~1.PNG'
(so an [existing] "SFN" path-part, & a SFN name-part, so then entire 'File' entry is a SFN)


how IrfanView actually recieves / interprets things is:
- SFN (path-part), *and* LFN (name-part)

In (particular) case, Lengths:
TOT = 264
PATH = 9
NAME = 255

so what is being sent to (received by) /IrfanView/ is a LFN (264 chars)
(rather then a "SFN" of, File 'C:\out\Z\254LFN~1.PNG')


different programs do react differently

WinMerge gets a "full" LFN, with both path & name in LFN format - as a "UNC" filename

Code: Select all

\\?\C:\out\254LFN ............................................................................................................................................................................................................................................. LFN254.png

winmergeU.exe 254lfn~1.txt (from a command-line)
where 254lfn~1.txt is a SFN of a LFN (of 255 char length)
does open & display 254lfn~1.txt,
but immediately hangs/crashes

winmergeU, in the case of Everything, & regardless of shell_execute_short_parameters=,
(via) Custom Command gets a "UNC" filename, & has no problem with that,
showing a name like: \\?\C:\out\Z\254LFN ...[~250 .'s here]... LFN254.TXT

Vim, via its' context-menu entry
opens a /directory-like listing/ of C:\out\Z

win32pad, notepad, wordpad, look to have no issues
win32pad & notepad show the full (255 char) filename, wordpad shows an 8.3 filename
(notepad run via double-click or Open With, others via Open With)

Code: Select all

disconnected from service
Everything:	1.5.0.1356a (x86)
OS:	Windows NT 6.1 7601 (x64)
Admin:	0
Service:	6 (connected / partially installed)
Command line:	-instance LFN -read-only
Binary:	C:\DEV\Locate\15.x-ish - LFN testoror\Everything.exe
Profile:	C:\DEV\Locate\15.x-ish - LFN testoror\Everything-LFN.ini
Database:	C:\DEV\Locate\15.x-ish - LFN testoror\Everything-LFN.db
Instance:	LFN
Config:	match_path=1
Config:	ignore_punctuation=1
Config:	show_mouseover=0
Config:	dupe_group_colors=1
Config:	highlight_max_or_paths=256
Config:	zoom=134
Config:	auto_include_fixed_volumes=0
Config:	find_first_file_path_not_found_retry_timeout=30000
Config:	icon_blend_hidden=1
Config:	thumbnail_medium_text_lines=3
Config:	thumbnail_large_text_lines=2
Config:	open_many_files_warning_threshold=9
Config:	set_foreground_window_attach_thread_input=0
Config:	snap_toggle_on_shift=1
Config:	rename_overwrite=1
Config:	allow_literal_operators=1
Config:	convert_forward_slash_to_backslash=1
Config:	operator_precedence=1
Config:	size_format=1
Config:	size_number_format=4
Config:	ellipsis=0
Config:	jump_to_timeout=99999
Config:	folder_rescan_timeout=60000
Config:	context_menu_parent_folder=1
Config:	custom_open_command01=$exec("C:\WLIB\PLAYERS\mpv.net\mpvnet.exe" %*)
Config:	custom_open_command02=$exec("C:\DEV\WinMerge\WinMergeU.exe" %*)
Config:	custom_open_command03=$exec("C:\BIN\i_view32.exe" %*)
Config:	filter=EVERYTHING
Config:	preview_icon=1
Config:	findbar_highlight_all=0
Config:	search_history_always_suggest=1
Config:	ntfs_volumes=[{"path":"C:","volume_name":"...
Config:	properties=[{"name":"Length","include_only_files":"*.3gp;*.asf;*.asx;*.avi;*.divx;*.f4v;*.flv;*.m2t;*.m2ts;*.m2v;*.m4v;*.mkv;*.mp4;*.mpe;*.mpeg;*.mpg;*.mov;*.mts;*.ogm;*.ogv;*.qt;*.ram;*.rm;*.rmvb;*.smil;*.swf;*.ts;*.vob;*.vp6;*.webm;*.wmv;*.h264;*.srt;*.part","fast_sort":1}]
("UNC" filename isn't the correct word, but...)

Just some text files...
.
254.LFN.zip
(7.4 KiB) Downloaded 145 times
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: 1357: LFN is broken

Post by therube »

(not that i know what the defaults are, offhand...)


As Everything automatically, translates LFN to SFN, where needed,
the Custom Command "LFN" setting, should do the same, by default,
so as to lessen confusion caused by seeing different behaviors
when using defaulted settings

if one chooses then to specifically change Custom Command "LFN" setting,
disabling it, Config: shell_execute_short_parameters=0,
then /they/ know that they did it (& with that, should know that they can
[potentially] expect to see different behaviors)


seems to me that to lessen confusion, behaviors should be the same
(or as same as they can be) regardless of how you happen to go about
things (i.e., double-click vs. Custom Command)
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: 1357: LFN is broken

Post by void »

Thanks for the issue report therube,
shellexecute invoke C:\out\Z\254LFN~1.MP4
shellexecute invoke InvokeCommand 800700ce
Error 800700ce is: filename is too long

The filename looks short to me!
This is a common issue when invoking a SFN that expands to LFN.

Everything opens files via the context menu by invoking the default verb.
The context menu is limited to 259 characters in the path. (even when using a SFN)
ShellExecute (while also limited to 259 characters in the path) will work with a SFN.



With shell_execute_short_parameters disabled, Everything will detect that the filename is a LFN and not use "invoke" and instead execute the filename directly.

Unfortunately, when shell_execute_short_parameters is enabled, Everything will convert the filename to a SFN and no longer detect that the filename is a LFN.
The SFN gets invoked and errors out.



Disabling shell_execute_invoke_id_list will help.
However, it may cause your files to open differently.

To disable shell_execute_invoke_id_list:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    invoke
  • Select shell_execute_invoke_id_list.
  • Set the value to: false
  • Click OK.
-When disabled, Everything will execute files with ShellExecute by filename (instead of invoking the default verb through the context menu)



The next alpha update will execute SFN (for files that are really LFN) with the filename instead of invoke when enabling shell_execute_short_parameters.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: 1357: LFN is broken

Post by void »

Everything 1.5.0.1359a will no longer use invoke on SFNs when they were LFNs (> 259 characters).

Instead, Everything will call ShellExecute with the short filename.
Post Reply