Sharing Pascal Files of a network - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Sharing Pascal Files of a network

dmeadleydmeadley Posts: 17Member
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?

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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).
  • PerranPerran Posts: 241Member
    : 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.
  • delljohnbdelljohnb Posts: 81Member
    : 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

  • Nor ArishamNor Arisham Posts: 20Member
    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....
Sign In or Register to comment.