Page 1 of 1

Important details about handles

Posted: Fri Dec 02, 2016 1:28 pm
by arfgh
If we use a ramdisk, to be used by the system temp uses, and also the user uses that can perform... then the most probably is that we have the 'explorer.exe' with some file handle opened during all time the machine is working.

Because Primo Ramdisk isnt capable to free the empty used space in WINDOWS XP, i perform several times per day the operation to 'reinitialize' that ramdisk. By the way i have to use other program to close the file handles, specially the ones set by 'explorer.exe'. And then kill 'explorer.exe' process and run it again, in order to gain access to be allowed to open again folders.

Image

Then i want to request to the Primo Ramdisk programmer, some kind of special detection of 'explorer.exe' process with file handles opened on the ramdisks, and if they exist, automatically close them, and then after the reinitialize the ramdisk, reload the process 'explorer.exe'.

I think that it would be very very userful that, and prevent system errors, etc.

Of course all this seems no necesary using windows over XP because the feature that automatically free the used empty space on the ramdisk...
But in windows XP......


greetings

Re: Important details about handles

Posted: Mon Dec 05, 2016 9:39 am
by Support
Actually simulated ramdisks just act like block-level hard disks and don't know anything about files or file handles. To implement such features, we also need to write some standalone tools like LockHunter you mentioned. However, I think you may try using scripts to implement such features.
Microsoft (sysinternals) tool "Handle" is a command-line tool to list and operate handles.
https://technet.microsoft.com/en-us/sys ... andle.aspx
And Primo Ramdisk supports command-line interface and you can reinitialize a ramdisk by using its "init" command.

Re: Important details about handles

Posted: Mon Dec 05, 2016 12:56 pm
by InquiringMind
Argfh,

To be fair to Romex, the feature you are asking for isn't likely to be of much use to most XP users since they would be using "invisible memory" for their ramdisk/cache which cannot be accessed by standard applications. It would only make a difference on 64-bit XP (which you mentioned using in a previous post) which is uncommon nowadays, to put it mildly.

The batch file approach (which you could also implement as an AutoHotKey macro for faster access) suggested by Support would seem the best workaround for your situation.

Re: Important details about handles

Posted: Mon Dec 05, 2016 1:54 pm
by arfgh
guys, one of the main usage of ramdisk, is to move the temporal data to it, in order to gain speed and avoid physical hdd fragmentation. Then the file handles are involved on that. In fact, explorer.exe refuse to open any window after the operation i explained, while it isnt killed and reloaded. So i think that the ramdisk manager should allow the user, with some settings, or some button, to close the file handles that are just opened on the ramdisk that go to be removed, obviously the user must know that if he hasnt saved the data.... blablalblalba...

Re: Important details about handles

Posted: Mon Dec 05, 2016 4:09 pm
by Jaga
So you want the Ramdisk to be a removable disk. That's fine, until you start putting folders on it like the Windows TEMP and TMP folders. Those need to be there for the entire session. I haven't tried to setup a Ramdisk as a removable before, maybe Support knows if it is possible.

Re: Important details about handles

Posted: Mon Dec 05, 2016 9:54 pm
by arfgh
^^ no, in fact and like i said, if we manually close the file handles, specially the one made by 'explorer.exe' and kill and reload the 'explorer.exe' process, all continue normal, the whole system.

Re: Important details about handles

Posted: Fri Dec 09, 2016 2:50 pm
by Support
In the ramdisk layer, it cannot know what handles are open, actually it knows nothing about any file information. So the feature you request is a completely standalone tool. As I suggested before, it can be reached by a batch file using MS handle tool (link is given in my previous post).

Assume the ramdisk drive letter is Z:, you may create a batch file and write the following command.

for /F "tokens=3,6 delims=: " %%I IN ('handle.exe z:\ -nobanner') DO handle.exe -c %%J -y -p %%I

After you reinitialize the ramdisk, you may just use this batch file to list and close all handles on Z: drive.
You may also merge the Primo Ramdisk CLI command "init" to this batch file. So you can just run the batch file to reinitialize the ramdisk and close all open handles on it.

BTW, if you want to directly run handle from the Command Prompt, use the following code.

for /F "tokens=3,6 delims=: " %I IN ('handle.exe z:\ -nobanner') DO handle.exe -c %J -y -p %I

Re: Important details about handles

Posted: Fri Dec 09, 2016 6:25 pm
by arfgh
what about a feature in Primo that allow us to run external program when the events Ramdisk removed, or, Ramdisk started ? It should be so useful.