When the file name is long it will be reported that the error can not be opened.Please solve this problem.
THANKS!
Regarding the length of the file name problem
Moderators: XnTriq, helmut, xnview
Re: Regarding the length of the file name problem
There is a Windows file name length limit I believe, but I don't know the value without checking.foxtail wrote:When the file name is long it will be reported that the error can not be opened. Please solve this problem. THANKS!
How long, can you post the file name or even the file?
If you are using XnView Classic, file names with unusual characters can't be opened as Unicode isn't supported, try XnView MP...
Re: Regarding the length of the file name problem
Are you trying to open it from local disk or from network share?
Re: Regarding the length of the file name problem
This is not quite correct that XnView can't open file with ANSI name reaching maximum length of 259 "whichever number Explorer allows" pure characters, which is defined in Windows constant MAX_PATH equal to 260 (last 260th = string terminating null-character). It can if you open such file from inside XnView. But when you doubleclick image in Explorer, filename is transferred to XnView as command line and last meaningful character (or more) is lost. Other programs which do not support Unicode too have no problem with opening file with max number of chars long name, so problem is on XnView's side.
+++
Started API Monitor to try to see what happens. Not sure if I picked proper functions to watch, but it seems in general XnView receives all filename string. Then something inside slices this string into parts, and for each part of filename XnView calls GetFileAttributesA function of winapi, which of course fail. Then for first part XnView calls FindFirstFileA, which fails too and finally for this reason is displayed error message with truncated filename.
+++
BUT! This behavior is spotted only in Win 2k and Win XP (I don't have other 32bit Windows to check). In Win 10 x64 XnView successfully opens files of max name length.
+++
Started API Monitor to try to see what happens. Not sure if I picked proper functions to watch, but it seems in general XnView receives all filename string. Then something inside slices this string into parts, and for each part of filename XnView calls GetFileAttributesA function of winapi, which of course fail. Then for first part XnView calls FindFirstFileA, which fails too and finally for this reason is displayed error message with truncated filename.
+++
BUT! This behavior is spotted only in Win 2k and Win XP (I don't have other 32bit Windows to check). In Win 10 x64 XnView successfully opens files of max name length.