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

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

corr
Posts: 136
Joined: Tue Jun 13, 2017 8:00 am

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

Post 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
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post by xnview »

Even if you change current folder in XnView?
Pierre.
corr
Posts: 136
Joined: Tue Jun 13, 2017 8:00 am

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

Post by corr »

Yes.
User avatar
user0
XnThusiast
Posts: 2414
Joined: Sat May 09, 2015 9:37 am

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

Post 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%
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post 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
Pierre.
corr
Posts: 136
Joined: Tue Jun 13, 2017 8:00 am

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

Post by corr »

By "close it" you mean close XnView in general?
User avatar
user0
XnThusiast
Posts: 2414
Joined: Sat May 09, 2015 9:37 am

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

Post 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
Last edited by user0 on Fri Oct 28, 2022 7:39 pm, edited 1 time in total.
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post 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 :(
Pierre.
corr
Posts: 136
Joined: Tue Jun 13, 2017 8:00 am

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

Post 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.
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post by xnview »

are you able to reproduce each time?
Pierre.
corr
Posts: 136
Joined: Tue Jun 13, 2017 8:00 am

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

Post by corr »

Yes.
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post by xnview »

i've tried several times but no success to reproduce :(
Pierre.
User avatar
user0
XnThusiast
Posts: 2414
Joined: Sat May 09, 2015 9:37 am

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

Post by user0 »

I still experience both issues (case A and B) in 1.4.0
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post 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?
Pierre.
User avatar
user0
XnThusiast
Posts: 2414
Joined: Sat May 09, 2015 9:37 am

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

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