function boinc_upload_file

Message boards : API : function boinc_upload_file
Message board moderation

To post messages, you must log in.

AuthorMessage
boinc42

Send message
Joined: 26 Nov 14
Posts: 7
Germany
Message 61234 - Posted: 27 Mar 2015, 11:08:37 UTC

Hello,

I have some problems with the function int boinc_upload_file(std::string& name).

My app creates a file "test" in the current slot. The function boinc_file_exists("./test") returns 1. Then I set string name = "test", then the function boinc_upload_file(name) returns 0, which seems to be right. On the server there aren't any sign of the file (e.g. in the table msg_from_host). Where are the uploaded files usually saved on the server?

I think the problem is, that trickle messages don't work properly. In the slot there is a trickle_up.xml file generated, if I use the function boinc_send_trickle_up("test", "<test>msg</test>"), but this file won't be send.

Thanks in advance.
ID: 61234 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 709
Finland
Message 61250 - Posted: 28 Mar 2015, 15:49:04 UTC - in response to Message 61234.  
Last modified: 28 Mar 2015, 16:02:16 UTC

Where are the uploaded files usually saved on the server?


The file ought to be in the upload directory hierarchy. Use "dir_hier_path test" to find out the right directory. If it isn't there check the client and server logs to see if anything was uploaded in the first place.

if I use the function boinc_send_trickle_up("test", "<test>msg</test>"), but this file won't be send.


The docs say that boinc_send_trickle_up() only sends a simple message to the server and you need to code the handler of the message and decide what the parameters mean. It doesn't send files unless you use the files' contents as messages.

edit: In the command "dir_hier_path test" you'll of course need to use the physical file name.
ID: 61250 · Report as offensive
boinc42

Send message
Joined: 26 Nov 14
Posts: 7
Germany
Message 61253 - Posted: 28 Mar 2015, 20:48:51 UTC - in response to Message 61250.  

Thanks Juha for the answer.

The trickle messages are working now. I forgot to wait after sending the trickle messages (now I wait with boinc_sleep(12) before the app is terminated).

But to upload my file doesn't work.

This is my code:

string file1 = "input"; //the open_name of the input template
string file2 = "test"; //test is a generated file in the current slot, but it hasn't an entry in any template

//out is the result file
out << boinc_upload_file(file) << std::endl; //0
out << boinc_upload_status(file) << std::endl; //-161 (ERR_NOT_FOUND)
out << boinc_upload_file(file2) << std::endl; //0
out << boinc_upload_status(file2) << std::endl; //-161 (ERR_NOT_FOUND)

boinc_sleep(12);

out << boinc_upload_status(file) << std::endl; //-161 (ERR_NOT_FOUND)
out << boinc_upload_status(file2) << std::endl; //-161 (ERR_NOT_FOUND)


This is the result file out:

0
-161
0
-161
-161
-161


In the BOINC manager event log I got:

[error] Can't find uploadable file test
[error] Can't find uploadable file input
ID: 61253 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 709
Finland
Message 61254 - Posted: 28 Mar 2015, 21:14:00 UTC - in response to Message 61253.  

I think you need to include every file you wish to upload in output template.
ID: 61254 · Report as offensive
boinc42

Send message
Joined: 26 Nov 14
Posts: 7
Germany
Message 61263 - Posted: 29 Mar 2015, 10:51:50 UTC - in response to Message 61254.  

Yes, you are right. Thanks.

Only logical files, which are listed in the output template, can be uploaded.
ID: 61263 · Report as offensive

Message boards : API : function boinc_upload_file

Copyright © 2018 University of California. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.