Unable to Delete = File In Use

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Unable to Delete = File In Use

Post by Zardoz2293 »

For approximately eight weeks now, new builds of XY can result in a version of XY which will create a file handle of a file copy and then the handle doesn't get deleted but unassociated with a non-existent process. Updating to a newer version of XY will sometimes result in the problem apparently going way, yet to return in a future update.

Tonight, I've spent the past couple of hours trying to find the source of the problem and it always associated with XY (and / or XYcopy). My environment is Windows 7 64-bit. It can occur as simple as making a backup copy of an executable, then immediately (or later, same XY session) attempting to delete the file. Always results in the "file in use" message. Open a command prompt at the directory location, unload XY, and delete the file manually always removes the file. However, if you were to attempt to unload XY and then reload XY to delete the file, the "file in use" message occurs.

Using Microsoft / Sysinternals Process Explorer to look at what has a handle to the file results in XY as the source, and in some cases for a single operation there may be half a dozen handles for the same file -- it's not consistent and what causes "more" to exist seems random, regardless of one or more the result is the same, unable to delete.

What brings me to post my concern now, rather than weeks ago, is, previously, the problem wasn't so stubborn as it is with the current 14.20.0203 variant. Typically there's absolutely no reason why I need to perform a warm or cold boot for months on end. However, tonight, I've done it a dozen times to find the culprit.

Clarification:
The only executable that will not delete are WinRAR SFX Executables.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

admin
Site Admin
Posts: 67299
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Unable to Delete = File In Use

Post by admin »

Hmm, strange, I have [never!] seen this here and I'm sure XY is not the cause of the issue. Simply because nothing in this has be changed in the code for a long time.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Unable to Delete = File In Use

Post by bdeshi »

Speaking of sysinternals, they have a tool called "handle". You can try that on the locked file to see if XY's got a open handle to that file. Run handle.exe -p xyplorer
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: Unable to Delete = File In Use

Post by Zardoz2293 »

SammaySarkar wrote:Speaking of sysinternals, they have a tool called "handle". You can try that on the locked file to see if XY's got a open handle to that file. Run handle.exe -p xyplorer
XY has the handle, that's why I've posted my concern.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: Unable to Delete = File In Use

Post by Zardoz2293 »

admin wrote:Hmm, strange, I have seen this here and I'm sure XY is not the cause of the issue. Simply because nothing in this has be changed in the code for a long time.
Well, if XY isn't "causing" the issue, then why is XY allocating locks on the file? More importantly XY continues to add additional locks on the file.

:veryconfused:

Update:
In the case of opening a WinRAR SFX the following happens:
1. Open WinRAR SFX inside of XY
2. XY puts a lock on the executable
3. WinRAR puts a lock on the executable
4. Exit WinRAR
5. WinRAR removes the lock on the executable
6. XY keeps its lock
For each time you perform a loop from 1 through 6, XY adds another lock on the file.
To see the attached files, you need to log into the forum.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

Zardoz2293
Posts: 638
Joined: 09 Nov 2011 20:20
Location: USA

Re: Unable to Delete = File In Use

Post by Zardoz2293 »

Utilizing LockHunter:

If I select, as in left-mouse click, a folder in the TV there will be 5 locks associated with XY. Why would there be more than 1 lock? It's the same number of locks (five) regardless of what folder is selected.

However, if I right-click a folder in the TV folder LockHunter reports zero locks, which is what I'd expect.

LockHunter reports XY has a lock on a file when the file is not highlighted in XY. The 'file' in question has the file-location-pointer indicator (or whatever it is called) on that file, but there should not be any locks on it.
XYplorer v28.50.0101

MacOS Tahoe v27.2.1 ; Parallels for Mac
VM (Client): Windows 11 Pro (AArch64), 26H2.26300.10075(10.0)
Display: Main=MacBook 4112 x 2570 @200%; External 3840 x 2160 @125%

admin
Site Admin
Posts: 67299
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Unable to Delete = File In Use

Post by admin »

LOL, I had forgotten a "never" in my first reply. I added it now.

Post Reply