|
-
April 25th, 2008, 02:17 AM
#1
create a new file with exclusive owner mode
Hello everyone,
I did some research for File.Create API to find some option which could be used to create a new file, with exclusive owner mode (e.g. other process/thread can not delete/open/modify when current thread keep the file open). But can not find it out.
Could anyone let me know which option should I use or which API should I use?
thanks in advance,
George
-
April 27th, 2008, 09:01 PM
#2
Re: create a new file with exclusive owner mode
Should look at the "lock" statement.
-
April 27th, 2008, 10:30 PM
#3
Re: create a new file with exclusive owner mode
Thanks mariocatch,
I am confused. Could you provide a link please? Which API do you mean?
 Originally Posted by mariocatch
Should look at the "lock" statement.
regards,
George
-
April 28th, 2008, 10:26 AM
#4
Re: create a new file with exclusive owner mode
type "lock" into your IDE and press F1. Or do an MSDN search for "lock".
-
April 29th, 2008, 06:32 AM
#5
Re: create a new file with exclusive owner mode
Thanks mariocatch,
But lock does not provide cross-process exclusive control, right?
 Originally Posted by mariocatch
type "lock" into your IDE and press F1. Or do an MSDN search for "lock".
regards,
George
-
April 29th, 2008, 01:40 PM
#6
Re: create a new file with exclusive owner mode
Look at the FileShare enumeration used by the FileStream class.
Another option is to use a named mutex and have each process lock/unlock the mutex.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|