Message boards : API : function boinc_upload_file
Message board moderation
Author | Message |
---|---|
Send message Joined: 26 Nov 14 Posts: 7 |
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. |
Send message Joined: 20 Nov 12 Posts: 801 |
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. |
Send message Joined: 26 Nov 14 Posts: 7 |
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 |
Send message Joined: 20 Nov 12 Posts: 801 |
I think you need to include every file you wish to upload in output template. |
Send message Joined: 26 Nov 14 Posts: 7 |
Yes, you are right. Thanks. Only logical files, which are listed in the output template, can be uploaded. |
Copyright © 2024 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.