Page 1 of 1

OS lock on directory after files closed

Posted: Tue Aug 05, 2003 10:14 am
by gormania
Textpad maitains an operating system handle lock on the directory that encloses any files it had open even after all files it had open in that directory are closed.

This means the directory cannot be deleted until textpad itself is closed.

This is particularly annoying to me as textpad is such a handy tool for taking a quick sanity glance at the contents of old directories that i am disposing off.

I have noted that cmd.exe (Command Prompt) seems to do the same sort of thing (perhaps not anymore). But am quite sure that the problem can be fixed.

Posted: Wed Sep 17, 2003 3:16 pm
by altan
YES, this is most irritating. I have now learned to immediately close Textpad when I cannot delete or rename a directory :!:

Posted: Thu Oct 23, 2003 5:25 pm
by wolfgang_j
It disturbs me massively.

I would actually call it a bug. I will create a bug report and hope it's not considered an offence against this forum's netiquette if I create a bug report from someone elses enhancement request.

Posted: Thu Oct 23, 2003 7:52 pm
by MudGuard
This is a known issue.

It has to do with "Working folder follows active document".

Workaround: turn off this option and set your working folder as the startup entry in the folder preferences.

Posted: Thu Oct 23, 2003 11:59 pm
by altan
Yes, I realize that. But when the active document is no longer 'active' it should not count as an active document (so textpad should switch to its own directory or something).

Posted: Fri Oct 24, 2003 7:07 am
by MudGuard
I would not like that - I often use that feature, I edit a file, close it and want to open another file from the same folder...

If it gets changed, it has to be configurable...

Posted: Fri Oct 24, 2003 1:20 pm
by bbadmin
The factor at work here is the concept of the current working folder. Every application that Windows runs has one, which starts out as either the folder containing the application, or whatever is defined as the initial working folder in the shortcut used to start it. In any application, the Open File dialog box generally changes the working folder to match that of the selected file. Additionally, in the case of TextPad, this folder may dynamically change to the one containing the active document, if Working folder follows active document is checked.

Windows will not permit a working folder to be deleted or renamed, so you must change working folder, in one of the ways described above, before you can do that.

Keith MacDonald
Helios Software Solutions

Posted: Fri Oct 24, 2003 7:52 pm
by jeffy
I'd like it if, when all documents are closed, that the current working directory changes to the one in which TextPad was installed. But remember the "actual" current working directory, as it was before the last document was

Then, if you call the "open" command, then just switch the working directory back to the "actual" one, before triggering the open dialog. If the directory doesn't exist, just give a dialog:

Code: Select all

Working directory does not exist.  Where would you like to go?

Button1:  <Recreate the working directory and go there>
Button2:  <Go to the default ("startup") directory>
Button3:  <Browse...>
I guess button 2 should be the default.

What do others think about this solution? I think it's a great idea. Thanks to gormania for sparking it in me! :' )

Posted: Fri Oct 24, 2003 11:28 pm
by wolfgang_j
I understand Keith's reasons but I really like Jeffy's idea.
It so often happens that I unzip something into a temporary folder, take a look at the README file and decide not to keep it. Having closed the README and TextPad minimized it's not possible to delete the stuff instantly. But I can live with MudGuard's tip for most situations, too. When I have opened files from one directory, TextPad is nice enough to use this directory (and not the default document folder) for SaveAs operations.

Wolfgang

Posted: Sat Oct 25, 2003 3:34 am
by altan
I want jeffy's design for Christmas :D

Posted: Sat Oct 25, 2003 9:03 am
by MudGuard
Jeffy, your idea seems acceptable, as it nullifies my "problem" with a switch to the default working directory - if it also works for a save on a new document...

Posted: Sat Oct 25, 2003 5:55 pm
by jeffy