Timing problem
Posted: Tue Aug 29, 2023 10:11 am
Hi Everybody,
Thanks for having me here!
At the moment I'm working on a project to handle files at a remote location using API's. Of course I'm using HTTPAPI (version 1.38).
One of the functions I need to build is a COPY-function, to duplicate a file at the remote location. Unfortunately they only offer a GET- and a PUT-API.
So what I do is first download the file to our local machine, using http_stmf(). This works like a dream. The next step is to upload the same file again, using http_url_post_stmf(). Technically this works fine again, but when I execute both calls in a program directly after another, I run into a timing problem: by the time I'm executing the second API, the file I downloaded to the IFS is still open and it fails to get added to the second call. (To add it to the second call I use http_mfd_encoder_addstmf() btw).
What actions do you recommend to fix this?
Yes, I know I should upgrade HTTPAPI to a more recent version, but that is out of my control alas. Is there perhaps a IFS-API I could use to check the open state of the file I downloaded?
Thanks again,
Annemiek.
Thanks for having me here!
At the moment I'm working on a project to handle files at a remote location using API's. Of course I'm using HTTPAPI (version 1.38).
One of the functions I need to build is a COPY-function, to duplicate a file at the remote location. Unfortunately they only offer a GET- and a PUT-API.
So what I do is first download the file to our local machine, using http_stmf(). This works like a dream. The next step is to upload the same file again, using http_url_post_stmf(). Technically this works fine again, but when I execute both calls in a program directly after another, I run into a timing problem: by the time I'm executing the second API, the file I downloaded to the IFS is still open and it fails to get added to the second call. (To add it to the second call I use http_mfd_encoder_addstmf() btw).
What actions do you recommend to fix this?
Yes, I know I should upgrade HTTPAPI to a more recent version, but that is out of my control alas. Is there perhaps a IFS-API I could use to check the open state of the file I downloaded?
Thanks again,
Annemiek.