Page 1 of 2

XnView locks directory, can not be deleted till XnView is closed

Posted: Sat Oct 08, 2022 3:42 pm
by corr
When I open an image with XnView in File Explorer, XnView can no longer delete this directory. Even from outside it is only possible when XnView is closed.

The only workaround I could find so far is to select in the Explorer context menu that the whole directory is opened with XnView instead of opening a picture. Unfortunately, this is not perfect.

Possible duplicate:
viewtopic.php?f=60&t=36539&p=155880

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Tue Oct 11, 2022 6:18 am
by xnview
Even if you change current folder in XnView?

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Tue Oct 11, 2022 10:03 am
by corr
Yes.

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Tue Oct 11, 2022 11:13 am
by user0
Can confirm this issue
However, it happens ONLY if image has been opened in Viewer mode (default settings) via doubleclick in File Explorer.
In that case it continues to block folder even if only <Empty> tab present.

---
XnView: MP 1.3.0 64bits (Sep 6 2022)
OS: Windows 64bit (21H1), display resolution 3840x2160, win scaling 150%

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Wed Oct 26, 2022 6:53 am
by xnview
I open from windows explorer a file into XnView MP (Edit mode), close it, and no problem to remove the folder of this file in windows explorer

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Wed Oct 26, 2022 7:03 am
by corr
By "close it" you mean close XnView in general?

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Wed Oct 26, 2022 7:40 am
by user0
Steps to reproduce in XnViewMP:

case A - general
1. associate images with XnViewMP
2. run Windows File Explorer, goto to test folder and open image via double-click
XnViewMP will open image in View mode
3. press Enter to switch to Browser mode
4. close image tab
if there are any intentional locks this suppose to eliminate them
5. step out of test folder in Browser mode
just in case
6. try to move/rename/delete test folder in Windows File Explorer
get message Folder in Use

case B - <Empty> tab
1. associate images with XnViewMP
2. in Settings (F12) and goto Interface → Tabs tab
3. untick 'Closing last tab exits XnView' checkbox
4. run Windows File Explorer, goto to test folder and open image via double-click
XnViewMP will open image in View mode
5. close all tabs
so there is only one <Empty> tab remain
6. try to move/rename/delete test folder in Windows File Explorer
get message Folder in Use
app_blocks_folder_if_file_opened_via_doubleclick.png

There are no such issue (folder is not blocked) if image opened manually.
1. run XnViewMP
2. in Browser mode navigate to test forlder and open image
3. move/rename/delete folder in Windows Fille Explorer
no issues here

Also there are no such issue in XnView Classic no matter how image is opened.

UPD
wording in Case A,B slightly updated

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Wed Oct 26, 2022 2:13 pm
by xnview
user0 wrote: Wed Oct 26, 2022 7:40 am case A
1. associate images with XnViewMP
2. open image in test folder via double-click in File Explorer
3. press Enter to goto Browser mode
4. Close image tab in XnView
5. step out of test folder in Browser mode
6. try to rename folder in windows File Explorer
it works :(

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Fri Oct 28, 2022 11:09 am
by corr
In my imagination and in the to be expected behavior as I know it from other programs, the block should be resolved when closing the image or at the latest when leaving the directory in the browser in XnView. Not by closing tabs or XnView itself.

Furthermore, the question is why does a block occur at all? Normally you can delete directories in other programs even if you are in them. If you open a picture from Explorer with Microsoft Photos you can even delete this picture while it is open.

It seems to me that there is a problem with how XnView opens images via a parameter.

I anyway don't use tabs and don't want to as I don't need them in my workflow. And even if I use tabs, I would have to open a new tab (and go back to the directory) if I want to continue working there.

For me the current behavior is a limitation of usability.

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Sun Dec 04, 2022 1:21 pm
by xnview
are you able to reproduce each time?

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Sun Dec 04, 2022 1:51 pm
by corr
Yes.

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Tue Dec 13, 2022 9:45 am
by xnview
i've tried several times but no success to reproduce :(

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Tue Dec 13, 2022 10:51 am
by user0
I still experience both issues (case A and B) in 1.4.0

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Thu Dec 15, 2022 11:03 am
by xnview
user0 wrote: Tue Dec 13, 2022 10:51 am I still experience both issues (case A and B) in 1.4.0
please send me the xnview.ini used?

Re: XnView locks directory, can not be deleted till XnView is closed

Posted: Thu Dec 15, 2022 3:27 pm
by user0
xnview wrote: Thu Dec 15, 2022 11:03 am
user0 wrote: Tue Dec 13, 2022 10:51 am I still experience both issues (case A and B) in 1.4.0
please send me the xnview.ini used?
sure, there are 2 files from two PCs, win10 and win11
xnview.zip
(9.91 KiB) Downloaded 37 times

issue is 100% reproducable on clean portable x64 version of xnviewmp
i can make a video if there are issues to reproduce described steps

the only settings I changed:
portable_setup.png