forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using DOWNLOAD@ with V8.10.0 and Plato 4.75

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 393
Location: Morrison, CO

PostPosted: Fri Oct 06, 2017 11:21 pm    Post subject: Using DOWNLOAD@ with V8.10.0 and Plato 4.75 Reply with quote

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.

Code:
 
  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
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 393
Location: Morrison, CO

PostPosted: Fri Oct 06, 2017 11:33 pm    Post subject: Reply with quote

Now that I have rebooted the machine, all the previously inaccessible executables have disappeared.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5043
Location: Salford, UK

PostPosted: Sat Oct 07, 2017 8:02 am    Post subject: Reply with quote

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".
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 393
Location: Morrison, CO

PostPosted: Sat Oct 07, 2017 2:45 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5043
Location: Salford, UK

PostPosted: Sat Oct 07, 2017 5:20 pm    Post subject: Reply with quote

I don't know but it wouldn't do any harm to put it back in.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 393
Location: Morrison, CO

PostPosted: Sun Oct 08, 2017 3:15 pm    Post subject: Reply with quote

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

One day, perhaps it will be revealed.....
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group