I have a self written FPC console program to upload files to a Cloud, which is connected via WebDAV. When I upload larger files, then this program seems to be finished, but in the Taskmanager of the OS I can see, that the upload needs a couple of more time to finish, which probably is caused by the WebDAV-Cache.
I want to be able to wait in my program, until the upload is really completed. E.g. for time measurements or for to wait, until I can read the file back, to compare if it's content is correct.
How can I do this wait?When I start during such an upload in a separate terminal the OS command 'ls <destination file>', then this ls-command waits, until the upload is finished, before it displays it's result.
Or when I start during such an upload an
external (second) FPC program in a separate terminal, which
- calls sysutils.FileGetAttr() for the destination file
- or calls sysutils.FindFirst() for the destination file
then this external FPC program also waits, until the upload is finished, before it returns.
But when I call the same things
from inside of the program, which has started an upload, then the same actions do
not wait:
- calling sysutils.FileGetAttr() for the destination file
- or calling sysutils.FindFirst() for the destination file
- or calling OS command 'ls <destination file>' via TProcess or RunCommandInDir().
Has someone an idea, why the same actions work, when started from outside of the uploading program, but does not work, when started from inside of the uploading program?
How can I fix this?If it matters: WebDAV is connected e.g. by command "mount /mnt/gmx" and in file /etc/fstab there is a line "
https://mediacenter.gmx.net /mnt/gmx davfs noauto,user,rw 0 0" for this.
I'm using FPC 3.2.2 on Linux Ubuntu 24.04 with KDE-Desktop.