|
-
August 6th, 2001, 03:03 AM
#1
Locking files
Can anyone tell me about the locks that I can put in files accessed using OPEN method? What is the difference between LOCK READ,LOCK WRITE,LOCK READ WRITE and SHARED?
-
August 6th, 2001, 03:22 AM
#2
Re: Locking files
Lock read = other processes (other programs) cannot read the file
Lock write = other cannot write to file (but can read it)
Shared= other can read or write the file
lock read Write = other cannot open the file for reading or for writing
Here a couple of example from MSDN
This code example opens the file in Binary mode for reading; other processes can't read file.
Open "TESTFILE" For Binary Access Read Lock Read As #1
This code example opens the file for sequential output; any process can read or write to file.
Open "TESTFILE" For Output Shared As #1
' Close before reopening in another mode.
Close #1
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|