FileExists and FileSize
Paul Timms
10-3-19
I have an interesting HAL problem. I have written an export, which uses CreateFile, WriteAreaToFile, and CloseFile. I am then using FileExists and FileSize to check that the file exists and is not empty.

WriteAreaToFile, FileExists and FileSize run by default on the server, whereas CreateFile and CloseFile run on the client. To make the other functions run on the client, I added them to a different procedure, which I'm calling with ClientRemoteAsync.procedure-name.

One of the variables I'm feeding into the client procedure is var boolean res, which is set as true if the file exists and is not empty.

The problem is that the value of res does not get fed back into the main procedure. I have traced res being set to true in the client procedure, but res is still false in the main procedure, immediately after calling the client procedure.


Has anyone got any ideas on how to run functions using ClientRemoteAsync which can feed a value back to the server function?
David Delač
10-30-19
Hi Paul,

I'm looking into this and I will reach back to you as soon as I have an answer to it. Thank you for your patience.


Best Regards,
David D.
HansaWorld
David Delač
12-4-19
Hi Paul,

I still didn't find an answer to this. I will update you once I have more information.

Best Regards,
David D.
HansaWorld
David Delač
12-5-19
Hi Paul,

Async functions do not wait for the client to process, so can not use any var declared arguments. Best way is to make a single call to the client and pass the area, this function then writes and checks the file size.


CreateFile/WriteAreaToFile/CloseFile use a different process than ClientRemoteAsync and could, when called from the server, execute significantly delayed

Best Regards,
David D.
HansaWorld
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Hello, Kindly please report the bug so that we can further investigate and resolve it. Thank you. Best regards, Benjamin...
11:31 3 May 2024
Hi, No changes should have been made that would increase client's HDB file. Please try to delete HANSA.HDB from client folder and reconnect to server and check if it will grow to 30MB again. ...
10:14 30 Apr 2024