OS lock on directory after files closed
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
OS lock on directory after files closed
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.
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.
-
- Posts: 3
- Joined: Thu Oct 23, 2003 5:20 pm
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
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
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:
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! :' )
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...>
What do others think about this solution? I think it's a great idea. Thanks to gormania for sparking it in me! :' )
-
- Posts: 3
- Joined: Thu Oct 23, 2003 5:20 pm
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
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