OS lock on directory after files closed

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
gormania
Posts: 1
Joined: Tue Aug 05, 2003 10:00 am

OS lock on directory after files closed

Post 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.
altan
Posts: 21
Joined: Mon Sep 15, 2003 12:50 am

Post by altan »

YES, this is most irritating. I have now learned to immediately close Textpad when I cannot delete or rename a directory :!:
wolfgang_j
Posts: 3
Joined: Thu Oct 23, 2003 5:20 pm

Post 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.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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.
altan
Posts: 21
Joined: Mon Sep 15, 2003 12:50 am

Post 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).
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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...
User avatar
bbadmin
Site Admin
Posts: 878
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post 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
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post 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! :' )
wolfgang_j
Posts: 3
Joined: Thu Oct 23, 2003 5:20 pm

Post 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
altan
Posts: 21
Joined: Mon Sep 15, 2003 12:50 am

Post by altan »

I want jeffy's design for Christmas :D
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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...
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post by jeffy »

Post Reply