Notepad3
Notepad3 copied to clipboard
Notepad3 locks the file directory and cannot delete the directory
When I open a txt file in a directory. I cannot delete the directory.
In Notepad3.c(v5.21.1129.1) 10675 line:
// change current directory to prevent directory lock on another path
HPATHL hdir_pth = Path_Copy(hopen_file);
Path_RemoveFileSpec(hdir_pth);
if (Path_IsExistingDirectory(hdir_pth)) {
SetCurrentDirectoryW(Path_Get(hdir_pth));
}
Path_Release(hdir_pth);
The SetCurrentDirectoryW API Locked the file directory.
I mean is that sometimes I open a lot of txt files. At this point I need to delete some folders, and often encounter a prompt that cannot be deleted. I have to close all open notepads. There is no problem in official notepad.
I think the SetCurrentDirectoryW call here should be removed.
Hello, I confirm: I've tested to delete the parent directory with 15 text editors (configuration: Out-of-the-Box):
-
12 text editors allow to delete the parent directory: "EditPadLite, EditPlus, EmEditor, Notepad++, Notepad2, Notepad2-mod, Notepad2-zufuliu, SciTE, Sublime, TextEditorPro, UltraEdit and VSCode" (12 on 15) 👍 😏
-
With 3 text editors the parent directory was blocked: "MS Notepad, Notepad2e and Notepad3" (3 on 15) 👎 🤔
I think the SetCurrentDirectoryW call here should be removed.
Hello @RaiKoHoff ,
In Notepad3.c, SetCurrentDirectoryW is present in 2 places: line_1062 and line_10679.
For test purpose, I've commented from line_10676 till line_10681.
Result: It seems to fix this issue... 🤔
Hello @nil-ref ,
Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_5.22.829.1_beta.paf" or newer, see 1st list in issue #1129.
"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.
Also, feel free to test the "BETA/RC Setup", version "Notepad3_5.22.829.1_beta_Setup" or newer, see the 2nd list in issue #1129.
Comments and suggestions are welcome... 😃