PC Review


Reply
Thread Tools Rate Thread

How to check if a file is used by another user

 
 
=?Utf-8?B?TGkgUGFuZw==?=
Guest
Posts: n/a
 
      8th Apr 2004
Hi

I'd like know how to check a file is used by another user

Thank

 
Reply With Quote
 
 
 
 
Jorge
Guest
Posts: n/a
 
      8th Apr 2004
Hi
Check FileInfo.Open Method.

Kind Regards
Jorge

>-----Original Message-----
>Hi,
>
>I'd like know how to check a file is used by another

user.
>
>Thanks
>
>.
>

 
Reply With Quote
 
Raymond Lewallen
Guest
Posts: n/a
 
      8th Apr 2004
Li,

Look at the File class, specifically the FileShare enumeration.
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemiofileclasstopic.asp

HTH,

Raymond Lewallen

"Li Pang" <(E-Mail Removed)> wrote in message
news:E5DA4E6F-7EC1-48C5-BAA3-(E-Mail Removed)...
> Hi,
>
> I'd like know how to check a file is used by another user.
>
> Thanks
>



 
Reply With Quote
 
Raymond Lewallen
Guest
Posts: n/a
 
      8th Apr 2004
Li, I didn't give you the correct information. I was thinking about
something else (I'm doing that alot lately :| ) I actually don't know how
to do what you are looking for. You might try the FileIOPermission class,
or start there anyways.

Raymond Lewallen

"Li Pang" <(E-Mail Removed)> wrote in message
news:E5DA4E6F-7EC1-48C5-BAA3-(E-Mail Removed)...
> Hi,
>
> I'd like know how to check a file is used by another user.
>
> Thanks
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      8th Apr 2004
Hi Li

When you go to the newsgroup

microsoft.public.dotnet.general

to the thread "ridiculous" it is on the top when you start at todays threads

There is discussion and also information about your question.

Cor


 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      8th Apr 2004
"Li Pang" <(E-Mail Removed)> schrieb
>
> I'd like know how to check a file is used by another user.


I think there is no way to check it. You can try to open it using the needed
access permission. If it fails, the file is locked.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
RDI
Guest
Posts: n/a
 
      9th Apr 2004
Or NOT FOUND.
"Armin Zingler" <(E-Mail Removed)> wrote in message
news:4075e0bc$1$26128$(E-Mail Removed)...
> "Li Pang" <(E-Mail Removed)> schrieb
> >
> > I'd like know how to check a file is used by another user.

>
> I think there is no way to check it. You can try to open it using the

needed
> access permission. If it fails, the file is locked.
>
>
> --
> Armin
>
> How to quote and why:
> http://www.plig.net/nnq/nquote.html
> http://www.netmeister.org/news/learn2quote.html
>



 
Reply With Quote
 
RDI
Guest
Posts: n/a
 
      9th Apr 2004
Or READ ONLY or in a READ ONLY directory--if on a network, this is VERY
possible.
"Armin Zingler" <(E-Mail Removed)> wrote in message
news:4075e0bc$1$26128$(E-Mail Removed)...
> "Li Pang" <(E-Mail Removed)> schrieb
> >
> > I'd like know how to check a file is used by another user.

>
> I think there is no way to check it. You can try to open it using the

needed
> access permission. If it fails, the file is locked.
>
>
> --
> Armin
>
> How to quote and why:
> http://www.plig.net/nnq/nquote.html
> http://www.netmeister.org/news/learn2quote.html
>



 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      9th Apr 2004
"RDI" <(E-Mail Removed)> schrieb
> Or READ ONLY or in a READ ONLY directory--if on a network, this is
> VERY possible.


I didn't say that only this error can occur. It is obvious that he/she has
to check /which/ exception was thrown.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
=?Utf-8?B?TGkgUGFuZw==?=
Guest
Posts: n/a
 
      19th Apr 2004
One solution may be to check the timestamp of the file. If it's changed then it can be considered as available again.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if an authenticated user can write to a file/directory? Paul Lemke Microsoft ASP .NET 2 14th Feb 2007 05:36 PM
check if file exists on user machine Galina Grechka Microsoft ASP .NET 4 13th Jan 2005 01:43 PM
RE: Check if file is open by another user/program. =?Utf-8?B?UmljaGFyZA==?= Microsoft C# .NET 2 3rd Aug 2004 09:57 PM
Re: Check if file is open by another user/program. Tim Ellison Microsoft C# .NET 1 3rd Aug 2004 07:47 PM
How to check if file has already been opened by another user =?Utf-8?B?SXZheWxvIEdlb3JnaWV2?= Microsoft C# .NET 0 29th Apr 2004 12:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:29 AM.