Simultaneous access to file (VB.NET) 
Author Message
 Simultaneous access to file (VB.NET)

Hello

I'm struggling with this problem. Perhaps someone has the answer. What
I am trying to do: I want the user to be able to select multiple files
and open them with my script. Problem: it opens as many sessions of
the same script as there are files.

A solution I found is by storing the files paths to be opened in a
queue in a text file on the C drive. The first program opened signals
the others through this file that he is in charge, the others add
their file to the queue, and the first program picks them up when he's
done with the first file (and each time thereafter).

Problem: I get simultaneous attempts to open the same file, which
fails the process. I partially solved that by introducing a random
timer that makes each process wait up to 1sec, so that it reduces the
probability. But I still get "collisions".

Is there a simpler way to getting multiple instances of the same
script to talk to each other simultaneously, or to make the script a
single instance and to collect the paths of the other files opened
from the program while it is running?

thanks in advance
Charles



Thu, 21 Apr 2011 18:48:31 GMT  
 Simultaneous access to file (VB.NET)
Hi Charles,

For VB.NET questions, best to ask in the dotnet groups such as :
microsoft.public.dotnet.languages.vb

As to your question it is relatively easy to set your app to a single
instance in VB.NET 2005 or later if you are using Windows.Forms. Open up the
application project properties, "My Project" and check the "Make single
instance application". Then click on the "View Application Events" button
and fro the code editor drop downs select MyApplication Events on the left
hand side and on the right select StartUpNextInstance.

If you have any follow questions or aren't clear on this, please post to the
dotnet group:
microsoft.public.dotnet.languages.vb


Quote:
> Hello

> I'm struggling with this problem. Perhaps someone has the answer. What
> I am trying to do: I want the user to be able to select multiple files
> and open them with my script. Problem: it opens as many sessions of
> the same script as there are files.

> A solution I found is by storing the files paths to be opened in a
> queue in a text file on the C drive. The first program opened signals
> the others through this file that he is in charge, the others add
> their file to the queue, and the first program picks them up when he's
> done with the first file (and each time thereafter).

> Problem: I get simultaneous attempts to open the same file, which
> fails the process. I partially solved that by introducing a random
> timer that makes each process wait up to 1sec, so that it reduces the
> probability. But I still get "collisions".

> Is there a simpler way to getting multiple instances of the same
> script to talk to each other simultaneously, or to make the script a
> single instance and to collect the paths of the other files opened
> from the program while it is running?

> thanks in advance
> Charles



Thu, 21 Apr 2011 19:11:19 GMT  
 Simultaneous access to file (VB.NET)
Great. Thanks!


Thu, 21 Apr 2011 19:28:17 GMT  
 Simultaneous access to file (VB.NET)


Quote:
> As to your question it is relatively easy to set your app to
> a single instance in VB.NET 2005 or later . . .

There you go again,{*filter*}head! Stop answering vb.net questions here where
they are off topic!

Idiot!



Thu, 21 Apr 2011 23:14:06 GMT  
 Simultaneous access to file (VB.NET)
Mike ,,,

Did you notice that this question was also posted in
microsoft.public.DOTNET.languages.vb

Take some bromo seltzer , before the acid burns through your stomach  ,,
relax man :-|

regards

Michel Posseth

I hope that you have noticed that this question was cross posted to


Quote:


>> As to your question it is relatively easy to set your app to
>> a single instance in VB.NET 2005 or later . . .

> There you go again,{*filter*}head! Stop answering vb.net questions here where
> they are off topic!

> Idiot!



Fri, 22 Apr 2011 03:37:11 GMT  
 Simultaneous access to file (VB.NET)


Quote:
> Mike ,,,  Did you notice that this question was also
> posted in microsoft.public.DOTNET.languages.vb
> Take some bromo seltzer . . .

No it wasn't! The question was posted ONLY in
microsoft.public.vb.general.discussion. Check your facts, idiot! I
personally added the dotnet group TO MY RESPONSE ONLY on the grounds that if
the Bill McCarthy (Most Valuable Puppet) fool insists on infesting the
Classic VB newsgroup spreading his dotnet propoganda as he has been doing
for months, despite repeated requests by dozens of people asking him to
stop, then I might as well annoy somebody on his own favourite dotnet group.
It certainly seems to have annoyed you, so it appears I was successful :-)

Take the seltzer yourself, boy. Oh, and get your facts straight next time!

Mike



Fri, 22 Apr 2011 05:13:33 GMT  
 Simultaneous access to file (VB.NET)
Some people seem to be prompt at blaming someone for being helpful...


Fri, 22 Apr 2011 05:29:31 GMT  
 Simultaneous access to file (VB.NET)



Quote:
> Some people seem to be prompt at blaming someone for being helpful...

No, not at all. There are a lot of helpful people in this group, answering
VB-Classic Q's. The only annoying thing is when replies are given in the
wrong group, other users of the language are not benefitting from the reply.
There is a looooong war going on in this group about answering .net Q's in
the correct group. You just happened to be in the wrong place at the wrong
time.

/Henning



Fri, 22 Apr 2011 06:37:42 GMT  
 Simultaneous access to file (VB.NET)
<sigh>
Seems that because I won't reply to Williams anymore he's trying his
darnest to get some attention.  Oh well, we've seen his silly spam attacks
in here before around the time he pretended to be his wife (what was up with
that ??).
Better stock up on the popcorn ;)



Quote:
> Mike ,,,

> Did you notice that this question was also posted in
> microsoft.public.DOTNET.languages.vb

> Take some bromo seltzer , before the acid burns through your stomach  ,,
> relax man :-|

> regards

> Michel Posseth

> I hope that you have noticed that this question was cross posted to




>>> As to your question it is relatively easy to set your app to
>>> a single instance in VB.NET 2005 or later . . .

>> There you go again,{*filter*}head! Stop answering vb.net questions here where
>> they are off topic!

>> Idiot!



Fri, 22 Apr 2011 11:37:56 GMT  
 Simultaneous access to file (VB.NET)
Michel,

The trouble in the vb.general.discussion newsgroup is that there are a lot
of helpfull persons.

However, there are as well some persons who have made their pupose of life
to call everybody an idiot.

Just don't pay attention to them, as most in the newsgroup
vb.general.discussion does.
You will most probably see after this message exactly what I mean.

Just to inform you,

Cor



Quote:
> Mike ,,,

> Did you notice that this question was also posted in
> microsoft.public.DOTNET.languages.vb

> Take some bromo seltzer , before the acid burns through your stomach  ,,
> relax man :-|

> regards

> Michel Posseth

> I hope that you have noticed that this question was cross posted to




>>> As to your question it is relatively easy to set your app to
>>> a single instance in VB.NET 2005 or later . . .

>> There you go again,{*filter*}head! Stop answering vb.net questions here where
>> they are off topic!

>> Idiot!



Fri, 22 Apr 2011 15:35:58 GMT  
 Simultaneous access to file (VB.NET)
Okay i was a bit to soon with my conclusion , only your answer was posted in
both groups  excuse me ,
However calling me now also  an idiot says more about you as it does about
me .

I see you were testing our group  response on 1-11-11:33 and were correctly
answered by PVDG42
Maybe you should be more active and answer also the off topic questions
sooner to prevent this

regards

Michel



Quote:


>> Mike ,,,  Did you notice that this question was also
>> posted in microsoft.public.DOTNET.languages.vb
>> Take some bromo seltzer . . .

> No it wasn't! The question was posted ONLY in
> microsoft.public.vb.general.discussion. Check your facts, idiot! I
> personally added the dotnet group TO MY RESPONSE ONLY on the grounds that
> if the Bill McCarthy (Most Valuable Puppet) fool insists on infesting the
> Classic VB newsgroup spreading his dotnet propoganda as he has been doing
> for months, despite repeated requests by dozens of people asking him to
> stop, then I might as well annoy somebody on his own favourite dotnet
> group. It certainly seems to have annoyed you, so it appears I was
> successful :-)

> Take the seltzer yourself, boy. Oh, and get your facts straight next time!

> Mike



Fri, 22 Apr 2011 14:27:59 GMT  
 Simultaneous access to file (VB.NET)


Quote:
> Okay i was a bit to soon with my conclusion . . .  However calling
> me now also  an idiot says more about you as it does about me .

Yes it does. It says that I do not take kindly to people like yourself who
tell me that I need to take bromo seltzer, especially when it was your own
mistake that led you to that erroneous conclusion.

Mike



Fri, 22 Apr 2011 23:30:11 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Simultaneous playback and recording using VB 6.0/VB.net

2. Access 2.0/VB 3.0/SQL 6.5 simultaneous read problem

3. Accessing vb.net class from non.vb.net apps

4. Random Access Files-vb.NET

5. how to launch an Access Application (mdb file) from VB.Net

6. VB.Net and access control lists settings on files

7. How to store file in an Access DB in VB.NET

8. Accessing File Summary Attributes via VB.NET

9. VB.net beta1 file access problem

10. Internet information server locks up on too many simultaneous accesses to a single script

11. Simultaneous Access and SQL Server support?

12. Simultaneous access to Jet 2.0

 

 
Powered by phpBB® Forum Software