forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


binfile

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
harry
Contributor
Contributor


Joined: 01 May 2003
Posts: 61

PostPosted: Thu Oct 04, 2007 6:36 pm    Post subject: binfile Reply with quote

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
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Oct 04, 2007 7:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Fri Oct 05, 2007 8:52 am    Post subject: Reply with quote

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
View user's profile Send private message
harry
Contributor
Contributor


Joined: 01 May 2003
Posts: 61

PostPosted: Fri Oct 05, 2007 2:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sat Oct 06, 2007 3:25 am    Post subject: Reply with quote

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
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sun Oct 07, 2007 4:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group