| View previous topic :: View next topic |
| Author |
Message |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Thu Oct 04, 2007 6:36 pm Post subject: binfile |
|
|
i'm using @BINFILE(READ,1,TEXT,%%filesize) on 3 computers and they all read from one file located on one box
all three computers can have the file open and read it at the
same time without having a error with binfile ? right?
thanks |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Oct 04, 2007 7:41 pm Post subject: |
|
|
Harry,
I believe so but without testing it I could not tell you for sure. You may have to open and close it and trap for error code 20. If you get an error code 20 then the file is opened exclusive. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Fri Oct 05, 2007 8:52 am Post subject: |
|
|
Ahh, so the error code 20 can also mean that the file is locked?
I always took the "File or path does not exist" error to be literal - even though the file often does exist. _________________ cheers
Dave |
|
| Back to top |
|
 |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Fri Oct 05, 2007 2:47 pm Post subject: |
|
|
well i ran 2 computers with the program on both at the same time
they each access the text file every3 seconds
for about 5 mins i opened the file that was being accessed and kept saving it
over & over and couldn't get it to choke on error 20
so binfile seems to allow a multi opened file without a shareing violation |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sat Oct 06, 2007 3:25 am Post subject: |
|
|
| harry wrote: | | so binfile seems to allow a multi opened file without a shareing violation |
So what happens if one app/user saves changes... and then later another app/user who opened the file before the changes were saved also saves the file with different changes?
Does the last save overwrite the first?
BTW is there any way with VDS to do proper file locking? _________________ cheers
Dave |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Oct 07, 2007 4:02 pm Post subject: |
|
|
| DaveŽ wrote: | | BTW is there any way with VDS to do proper file locking? |
Well we have been trying to do this for years but there has been no way in VDS until Gadget came along and then VDS 5's @lib. It is quite easy to do with Win32 API but needs lots of boiler plate code just to perform the 3 functions CreateFile, LockFile, UnLockFile. If I get a chance I will build a DSU to lock files for you guys. Right now I am trying to finish the new build of GadgetX with several fixes and even more abilities.
BTW LockFile allows you to lock the whole file or specific parts of a file. On Windows most early databases used these functions to control access to records. Today's databases don't do this they control access to records through the use of ACL (i.e. ... Access Control Lists). In other words it is easier to control access to a record in a file by setting a switch in a central program that all other processes request access from than to try to lock out specific bytes in a file and deny access to all others which is prone to lots of error handling. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|