Sign in to follow this  
Followers 0
Dempex

Multiple users of a file

3 posts in this topic

When a single file is shared between 4 programs. Is it possible to "test" on that file how many is in it at the same time ?????? :D:D Its driving my brain nuts those days but if one have some ideas it would really be great.

I dont have anything with the 4 programs to do, they are working in dependent of me :)

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

i remember reading somewhere about a program/autoit script (maybe on forums) that checks to see what a file is being used by.

edit: maybe i just dreamed it lol...

Edited by burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Hello,

I remember that you have asked a similar question.

I have already told about http://www.sysinternals.com/ntw2k/freeware/handle.shtml

If you use this program with this script, I think that it could help you (I hope)

;test if a file is used by several processes

$fic=FileOpenDialog("Chosse the file to monitor",@MyDocumentsDir,"(*.*)",3); file to monitor
if $fic=-1 then Exit
$fic='"'&$fic&'"'
Runwait(@ComSpec & " /c handle.exe "&$fic&" > "&@TempDir&"\loghandle.txt","",@SW_HIDE) 

$fic2=FileOpen(@TempDir&"\loghandle.txt",0)
$index=6; the list of processses begin at the line 6
$nameprocesses=""
while 1
    $line=FileReadLine($fic2,$index)
    if @error=-1 or $line="No matching handles found." then ExitLoop
    $tab=StringSplit($line," ")
    $nameprocesses=$nameprocesses&$tab[1]&" PID "&$tab[9]&@CRLF; for each line the first element is the name of the process and the PID is 9th 
    $index=$index+1
WEnd
MsgBox(0,$fic& "is used by :",$index-6 &" process(es)"&@CRLF&$nameprocesses)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0