I've been experimenting with this DOWNLOAD@ function, and finding it will be useful to communicate with users about new versions. When doing this, the file I download is only several bytes long.
I also thought I might be able to download the entire software install for them. Which is true, but appears to cause the following problems as I'm debugging the process and resulting file creation. I've included the sample code below which is essentially right out of the on-line documentation. I'm using Plato to do all the code/compile/run. The file I'm trying to download is 29,657,311 bytes long.
What happens is that the small program runs to completion, showing the file size correctly after the first call, then the second call (that actually downloads the data file) appears to be successful. This is where it gets weird. If I then do a REBUILD (no code changes), the executable can't be rebuilt. The error I get is: *** Unable to create executable file: Release\Win32\main3.exe'. 3 was the latest incarnation of this problem.
When I go to the folder that contains the executable, I cannot view any of the security or permissions for that file, even if I log in as the machine administrator. The OS (Win 10) tells me that I cannot view anything about this executable file. Nor can I run it anymore.
I can compile and link (rebuild) the executable multiple times, with no problems.
If I have run the program (externally from Plato) a few times, then re-enter Plato and attempt a rebuild, I get the 'Unable to create' error message and the file has the weird permissions.
If I compile and link the program, exit Plato, then run the program standalone after building, it runs successfully, even multiple times. I can view the permissions, delete the executable file, etc.
If I then delete the executable and re-enter Plato, it will rebuild, no problem. I can then exit Plato, re-run the executable, all appears to be well.
I don't know what I may have done to get this behavior., nor how to get rid of the resulting files.
INCLUDE <clearwin.ins>
INTEGER err,fileSize
INTEGER(7)handle
CHARACTER(80) url
url = 'http://www.cjdsoftware.com/gammatest/Setup_C-Master_7.4.23.dat'
err = 0
fileSize = 0
handle = DOWNLOAD@(url, fileSize, err)
IF(err > 0) STOP 'Download failed'
print *,'File Size=',filesize
handle = DOWNLOAD@(url, fileSize, err)
print *,'Error=',err
CALL RETURN_STORAGE@(handle)
stop
end