Hi Warren,
How about a bit of ActiveX?
Using the FileSystemObject contained in the MS Scripting Runtime library
(scrrun.dll on my system), you could set and clear the Read Only attribute
of your file programmatically.
On my system (WinNT), trying to write to a ReadOnly file from VEE returns
Error 702 (Cannot open file <name>: Permission Denied)
Regards
Paul
---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo. To send messages to
this maillist, just email to "vrf@lvld.agilent.com". Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.agilent.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.agilent.com".
---------------------------------------------------------------------
Doesn't this just move the problem from the data file to the lock file?
I don't have much experience with this kind of problem, but aren't databases
set up to deal with this kind of contention? If so, that might be an avenue
worth exploring.
Bill Ossmann
--
bill_ossmann@hsgmed.com
Philips Ultrasound
>-----Original Message-----
>From: Michael Asbery [mailto:michael.asbery@nrl.navy.mil]
>Sent: Tuesday, February 26, 2002 10:12 AM
>To: 'VEE Reflector'
>Subject: RE: vrf Locking a file
>
>
>Warren,
>
>A simple way would be to have your program create a file
>locking thread such
>as:
>
>Does "file.lok" exist ?
> Yes - Wait until file is not there
>
> No - Create "File.lok" , read and write to your data file , delete
>"file.lok"
>
>This method tests for file existence.
>Another way would be to write a value into the file "File.lok"
>and test for
>that value.
>
>
>Mike
>***********************************************************
>Michael N. Asbery, NRL Code 5733.20, (202)404-3014, DSN 357
>michael.asbery@nrl.navy.mil fax (202)404-7661
>***********************************************************
>
>
>-----Original Message-----
>From: owner-vrf@lvld.agilent.com [mailto:owner-vrf@lvld.agilent.com]On
>Behalf Of Pickles, Warren
>Sent: Tuesday, February 26, 2002 9:34 AM
>To: 'VEE Reflector'
>Subject: vrf Locking a file
>
>
>Hello all
>
>I have a situation where multiple test station computers need
>to read from
>and write to the same file. The (simplified) reason for that
>is that all
>the stations are testing units that are part of the same order
>and so each
>station needs to know when the order is complete and the
>operators can go
>home.
>
>The problem is that occasionally the data in the file
>disappears or gets
>mangled. I believe that's because two stations are accessing
>the file at
>the same time, and so my software gets confused.
>
>My question is: does anyone know how to get VEE to put a lock
>on a file so
>that the same VEE program running on another computer cannot
>access the file
>until is unlocked?
>
>Thanks,
>
>Warren Pickles
>
>---------------------------------------------------------------------
>This is the "vrf" maillist, managed by Majordomo. To send messages to
>this maillist, just email to "vrf@lvld.agilent.com". Subscriptions and
>unsubscriptions are done through the address
>"vrf-request@lvld.agilent.com".
>If you need details, just send a message containing the text "help"
>to "vrf-request@lvld.agilent.com".
>---------------------------------------------------------------------
>
>---------------------------------------------------------------------
>This is the "vrf" maillist, managed by Majordomo. To send messages to
>this maillist, just email to "vrf@lvld.agilent.com". Subscriptions and
>unsubscriptions are done through the address
>"vrf-request@lvld.agilent.com".
>If you need details, just send a message containing the text "help"
>to "vrf-request@lvld.agilent.com".
>---------------------------------------------------------------------
>
---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo. To send messages to
this maillist, just email to "vrf@lvld.agilent.com". Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.agilent.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.agilent.com".
---------------------------------------------------------------------