Silverfrost Forums

Welcome to our forums

Using DOWNLOAD@ with V8.10.0 and Plato 4.75

6 Oct 2017 10:21 #20394

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
6 Oct 2017 10:33 #20395

Now that I have rebooted the machine, all the previously inaccessible executables have disappeared.

7 Oct 2017 7:02 #20399

The message 'Unable to create' usually means that the previous run of the executable has not shut down properly after an exception has been raised.

Open the Task Manager by right clicking on the taskbar, find the executable, right click on it and select 'End task'.

7 Oct 2017 1:45 #20401

Paul, I tried that and could not find an instance of the executable in the task manager under any name (Plato, main, ...). I agree, something is not getting shut down correctly, but for the life of me, I cannot figure it out.

Odd that it did not do this when I was experimenting with a much smaller file.

Is this a clue: In the example in the Help file, the file size returned by the first call has 4 added to it before the call that actually downloads the file. I had removed this addition because it seemed to serve no purpose.

7 Oct 2017 4:20 #20405

I don't know but it wouldn't do any harm to put it back in.

8 Oct 2017 2:15 #20408

I put it back in, and the problem went away.

One day, perhaps it will be revealed.....

Please login to reply.