Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Sharing Pascal Files of a network Posted by dmeadley on 15 Oct 2003 at 1:26 AM
I am currently building a system for an organisation using boland pascal 7. Part of the requirement is to share TYPED data files over a network. This will involve 2 or more users having access to the same file and will be able to edit, delete and add records.

Can it be done and if so, how?

Report
Re: Sharing Pascal Files of a network Posted by zibadian on 15 Oct 2003 at 2:11 AM
: I am currently building a system for an organisation using boland pascal 7. Part of the requirement is to share TYPED data files over a network. This will involve 2 or more users having access to the same file and will be able to edit, delete and add records.
:
: Can it be done and if so, how?
:
:
It can be done, provided that you don't open the file for too long, since only 1 copy of your program can open the file at a time.
You can also let the program make a copy of the file at startup and then it can open the copy for as long as needed. Once in awhile you can synchronize the changes made to the copy and the master file. This way you can use a more traditional coding. A second advantage of this method, is that the copy can be stored locally, and your program can also be used on a stand-alone computer without much recoding (it just needs to disable the synchronization).
Report
Re: Sharing Pascal Files of a network Posted by Perran on 15 Oct 2003 at 5:01 AM
: I am currently building a system for an organisation using boland pascal 7. Part of the requirement is to share TYPED data files over a network. This will involve 2 or more users having access to the same file and will be able to edit, delete and add records.
:
: Can it be done and if so, how?
:
:
Why don't you implement a simple record-locking routine? I don't know if share still comes on Wintel boxes, but, if it doesn't, take a look at an old DOS book to see how to use it.
Report
Re: Sharing Pascal Files of a network Posted by delljohnb on 16 Oct 2003 at 12:46 PM
: I am currently building a system for an organisation using boland pascal 7. Part of the requirement is to share TYPED data files over a network. This will involve 2 or more users having access to the same file and will be able to edit, delete and add records.
:
: Can it be done and if so, how?
:
:
This is the same problem faced by Windows during filesharing of files stored on the server. Windows generally permits this to be accomplished by moving a copy of the file to the users system, then closing the file on the server. When th user is "done" with the file, the user simply saves it to the server, effectively overwriting the the server's copy. There are problems inherently here also, but there is no other means of making a dynamic file that I think that you are looking for....a way would be to simply have the client unit query the status of the file prior to overwriting it to see is another user had modified it since the user downloaded their copy. Whew....alot of work there....good luck

Delljohnb

Report
Re: Sharing Pascal Files of a network Posted by Nor Arisham on 20 Oct 2003 at 12:50 AM
try this :-

to open files on network :-

assign(fv,'data.dat');
filemode:=64; {unlock}
reset(fv);
filemode:=savemode;
total_rec:=filesize(fv);
-----------

if you need to save then use use this before write :-

assign(fv,'data.dat');
filemode:=2; {lock}
reset(fv);
filemode:=savemode;
seek(fv,total_rec);
write(fv,rec);


try out!..msg if u success....



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.