1

Topic: Saving in ini on a cloudy disk

There is a cloud connected in the form of a folder (faced with DropBox, Mail.ru and still someone's). Application lives on it. At application closing all adjustments are thrown off in ini.
Here on this moment error EFCreateError - Cannot create file "C:\Users\jagunso-pc\Dropbox\macros\Stealth_v8.5.8\Stealth.ini" from time to time takes off. The process cannot access the file because it is being used by another process.
At MemIni. UpdateFile;
On the moment
Stream: = TFileStream. Create (FileName, fmCreate);
Rarely enough, at different users, but it is regular.
We assume that angrily in synchronization when during this moment the file exclusively is engaged for check or something something like that.
Someone can faced how to struggle? To try to repeat through pair hundreds msec saving, or still that...

2

Re: Saving in ini on a cloudy disk

Vizit0r;
Replace
Stream: = TFileStream. Create (FileName, fmCreate);
On
Stream: = TFileStream. Create (FileName, fmCreate or fmShareDenyWrite);

3

Re: Saving in ini on a cloudy disk

AltHasp wrote:

replace
Stream: = TFileStream. Create (FileName, fmCreate);
On
Stream: = TFileStream. Create (FileName, fmCreate or fmShareDenyWrite);

idea correct, but does not fly up

fmCreate = $FFFF;
fmShareDenyWrite = $0020;

or in what does not result.
The decision: to use THandleStream +  CreateFile

4

Re: Saving in ini on a cloudy disk

On the contrary, it is necessary to select access at other applications to a file while to a file there is an operation. Or to write all for once (to one transaction). Or to write adjustments to a temporary file and when all will be ready - to copy it to the place of the old. Curve service of synchronization catches change of a file and at once starts it to synchronize, whereas other parts of application had not time to be saved there yet.