Jump to content

PDN doesn't unlock folders


Recommended Posts

Paint.net isn't releasing folder handles to images that PDN opens when those images are closed (preventing modification/deletion of the folders themselves while pdn is still open). file handles themselves are released correctly, allowing the deletion of the files, but not the folder handle

Link to comment
Share on other sites

@Rick:

OK, open a file in Paint.NET, then try to rename it or delete it. You can't (duh) because Paint.NET has the file handle. Now try to rename or delete the folder it's in. Still can't, as expected. Now close the file (but leave Paint.NET open). You can now do whatever you want to the file, but still not the folder. For some reason, Paint.NET is not properly releasing the folder handle. Once Paint.NET is closed, you have control again.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

This doesn't repro for me. Paint.NET does not keep the file, or the containing folder for that matter, open after it has loaded it. Maybe you have some plugin or shell extension that's doing something Wrong.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

I removed all of my plugins just to be sure. Now it doesn't hold the file open, but under certain conditions the folder is still grabbed.

Open Paint.NET, File > Open or Open Recent:

Nothing held, normal behavior as you described.

Find file in Explorer, RMB > Open With > Paint.NET

Folder held open by Paint.NET, unmodifiable until Paint.NET is closed.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

It'd definitely PaintDotNet.exe that has the file handle on the folder. Not only is it modifiable again the moment Paint.NET is closed, but Process Explorer confirms it. One strange thing I noticed in Proces Explorer though, was that if I started Paint.NET via its shortcuts, then did a File>Open, its working directory is its install dir. However, if I open via a file, procexp shows that Paint.NET believes its working directory to be the directory of the file used to open it. Oh, and in that situation, it doesn't even have a handle on its install directory, which it does when started w/o an image passed as a command line.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

yes, Pyrochild has explained it completely. if I start PDN manually (by using the program icon), I can open a file (by either the file -> open dialog box, or from windows explorer), close it, and delete the file and it's folder. however, if I do not have PDN open, and I open a file from windows explorer, PDN opens with the file. after I close the file, I am unable to delete the folder that contained the file, as an example I'll be using C:/test/test.png.

[Windows Explorer] open PDN,

[PDN or W E] open test.png,

[PDN] close test.png

[W E] delete C:/test

results in C:/test/test.png DELETED, C:/test DELETED

***

[W E] open test.png

[PDN] (opens with test.png)

[PDN] close test.png

[W E] delete C:/test

results in C:/test/test.png DELETED, C:/test "cannot remove folder test: It is being used by another person or program."

[PDN] exit program

[W E] delete C:/test

results in C:/test DELETED

{edit: replaced backslashes with forward slashes, although it looks weird, but not as weird in the preview, now,,, and removed previous note}

Link to comment
Share on other sites

Is this in XP or Vista, or either?

On my system Process Explorer reports the "Current Directory" as either (1) the install dir (start -> paint.net), or (2) C:\Windows\System32 (file -> open with -> paint.net), or (3) the directory of the file (file -> edit).

Anyway that makes sense that you can't delete the directory if it's the process' current directory.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...