Delphi - Write/read files in a shared environment
===

I have some problems on files which are placed in a LAN: there is a single Delphi program (server) which should write some files, which can be only read by multiple Deplhi programs (clients).
I use these simple instructions in the server for writing (DataList is a TStrings):

    Stream:=TFileStream.Create(filePath,fmOpenWrite or fmShareDenyWrite);
    try
     DataList.SaveToStream(Stream);
    finally
     Stream.Free;
    end;

The clients check every 5 seconds if the file above is modified (by just checking the FileAge), and if modifications are occurred, they load the DataList in the following way:

    try
     Stream:=TFileStream.Create(filePath,fmOpenRead or fmShareDenyNone);
     DataList.LoadFromStream(Stream);
    finally
     Stream.Free;
    end;
 
Normally everything works perfectly, but sometimes it happens that the server or the client raise an exception because "the file is in use by other process".
I don't understand which is the problem: I tried many alternatives, but this can happen also with just the server and only one istance of the client running..

Any ideas?

Thanks!